Question: Concatenation of Samtools Faidx - 60nt limit by line
0
gravatar for ryan.leenay
15 months ago by
ryan.leenay0 wrote:

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 sequence R • 421 views
ADD COMMENTlink modified 15 months ago by Carlo Yague4.4k • written 15 months ago by ryan.leenay0
0
gravatar for Carlo Yague
15 months ago by
Carlo Yague4.4k
Belgium
Carlo Yague4.4k wrote:

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 COMMENTlink written 15 months ago by Carlo Yague4.4k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1225 users visited in the last hour