Hello everyone,

I guess it will be a very silly mistake, but I am not able to make this work. 

I am using the biomaRt package to obtain the chromosome length of different chromosomes of the human genome. The thing is, when retrieving other information such as the ensembl ID, it works well (using other filters). However, with this code, the programme never stops running. Why? What am I doing wrong?

    mart_h <- useMart("ENSEMBL_MART_ENSEMBL", dataset = "hsapiens_gene_ensembl")
    test <- getBM("chromosome_end", filters="chromosome_name", values=c(1:2), mart_h)
    test_2 <- getBM("chromosome_end", filters="chromosome_name", values=1, mart_h)

I know there are more efficient ways of obtaining these lengths, but I would prefer using this package (this code it is part of a pipeline). 

Thank you very much, I am pretty sure it will be a very silly thing, but I am not able to solve this.

Have a nice day!
An alternative and simpler way to obtain chromosome lengths is to use the `GenomeInfoDb` Bioconductor package:

    library(GenomeInfoDb)
    Seqinfo(genome="hg38")
    Seqinfo object with 455 sequences (1 circular) from hg38 genome:
      seqnames         seqlengths isCircular genome
      chr1              248956422      FALSE   hg38
      chr2              242193529      FALSE   hg38
      chr3              198295559      FALSE   hg38
      chr4              190214555      FALSE   hg38
      chr5              181538259      FALSE   hg38
      ...                     ...        ...    ...
      chrUn_KI270753v1      62944      FALSE   hg38
      chrUn_KI270754v1      40191      FALSE   hg38
      chrUn_KI270755v1      36723      FALSE   hg38
      chrUn_KI270756v1      79590      FALSE   hg38
      chrUn_KI270757v1      71251      FALSE   hg38

The chromosome lengths are stored in the column *seqlengths*. Take a look at `?Seqinfo` for details.