wrong output for Human GENE in R
1
0
Entering edit mode
6.9 years ago

Hi 

I'm trying to get the sequence of the gene for human. so in R i attached library BSgenome.Hsapiens.UCSC.hg19 and then when I use this command "BSgenome.Hsapiens.UCSC.hg19$chr1" i just faced with something like this:

NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN

where is the problem?

sorry for my poor English

Tanks

mansoor

gene Human • 1.1k views
ADD COMMENT
0
Entering edit mode

thank u Devon 

but i have another question what is different between your code and mine?!?!?

seq= BSgenome.Hsapiens.UCSC.hg19$chr1[1e7:10000100]

ADD REPLY
0
Entering edit mode

They may produce the same results, mine just uses the accessors rather than coercing datatypes. Using the accessors has the advantage of some error checking and dealing with strands.

Edit: Using the accessors also has the benefit that you don't rely on the underlying class maintaining its representation. An accessor is going to get updated with the package, even if the class structure provided in the package changes radically.

ADD REPLY
2
Entering edit mode
6.9 years ago

chr1 in hg19 starts with a bunch of Ns, so it's unlikely that you did anything wrong. BTW, you may find it simpler to make a GRanges object and then use getSeq().

gr <- GRanges(seqnames="chr1", ranges=IRanges(start=1e7, end=10000100))
getSeq(BSgenome.Hsapiens.UCSC.hg19, gr)
  A DNAStringSet instance of length 1
    width seq
[1]   101 AACCCCGTCTCTACAATAAATTAAAATATTAGCT...TTGGCGGGCTGAGGTGGGAGAATCATCCAAGCC

 

ADD COMMENT

Login before adding your answer.

Traffic: 2611 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6