Concatenation of Samtools Faidx - 60nt limit by line
1
0
Entering edit mode
7.9 years ago

Hello,

I am attempting to use samtools faidx to pull down a sequence to do some visualization in R. My current code reads:

(within R)

system(sprintf("samtools faidx Genome/hg38.fa chr:36287064-36287162,intern = TRUE)[[2]])

But unfortunately, the R only outputs the first 60 nucleotides. When I run the samtools faidx function on command line, I can see that the second line is below the first 60nt.

Is there a samtools option I can specify to have it be on a single line? I can write an R script to figure that out, but I would like to avoid that, as this range/size will change and not all ranges will be over multiple lines.

Thank you!

samtools R sequence • 1.9k views
ADD COMMENT
0
Entering edit mode
7.9 years ago

There is no built-in option in samtools faidx to output an one-line fasta. However you can pipe the output into awk to get the desired format, as explained in this thread.

ADD COMMENT

Login before adding your answer.

Traffic: 18921 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