[Biopython] Writing fasta+qual files and adjusting adapter clip positions in sff files
Peter Cock
p.j.a.cock at googlemail.com
Wed Apr 6 10:07:03 EDT 2011
On Wed, Apr 6, 2011 at 2:54 PM, Martin Mokrejs
<mmokrejs at fold.natur.cuni.cz> wrote:
>Peter wrote:
>> I'm a bit confused if you are trying to write out a new trimmed SFF file, a pair
>> of trimmed FASTA and QUAL files, or even a trimmed FASTQ file. All of
>> those are possible with Biopython.
>
> I wanted either trimmed fasta+qual or trimmed sff (preferably) both with my _new_
> trim points. From the above it is now clear for fasta+qual it can be done through
> biopython ...
Yes, and it is easy as you can just slice the SeqRecord objects.
> ... while for sff alterations/creations I have to stick to sfffile (which
> is fine for me).
No, you can do that in Biopython too - very similar to the example you
quoted. You load the SFF file in, move the trim points by changing
the values of record.annotations["clip_qual_left"] and/or
record.annotations["clip_qual_right"] then save this as a new
SFF file. Note you need to use Python zero-based counting.
Peter
More information about the Biopython
mailing list