This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Flipping a DNA sequence (not reverse complementing) using command line/samtools?

Hi all,

I have BioNano Scaffolds of sequence data (no solid reference at the moment) and I am trying to orient them in the correct way to so I can do PCR and attempt to complete the sequence. One of my scaffolds is 67 MB, but I believe (based on BLATs and other context clues from the project) that this sequence is actually reversed. Is there a way using samtools or the command line to easily flip this sequence? Given that it is so big I would rather stay on the cluster and not have to download it to my computer to try and flip - but if that is what I need to do so be it.

Thanks so much!

contigs scaffolds bionano sequencing

If your sequence is in plain text format, you can get the reversed sequence with a simple rev command (which is usually built-in):

echo "ACGTAG" | rev
GATGCA

2 answers

seqkit seq -r seq.fa > rev.fa.

Install seqkit from here.

If you have the emboss package installed on the server you can use revseq seq.fa -reverse -nocomplement -outseq seq.rev.fa.

Awesome, I'll install that if we don't - thanks so much I appreciate it!

Log in to answer this question.