[Biopython-dev] [BioPython] about the SeqRecord slicing

Jose Blanca jblanca at btc.upv.es
Thu Mar 26 12:24:59 UTC 2009


Fisrt of all sorry for sending the last mail to the BioPython general list.

On Thursday 26 March 2009 13:05:25 Peter wrote:
> Can you give me an example of where you want to pull out a single
> character from a SeqRecord, and its quality?  I would consider things
> like this quite elegant:
>
> for letter, quality in zip(record.seq,
> record.letter_annotations("phred_quality") :
>    #do stuff
I'm implementing a Contig class similar to the Alignment class but with the 
added capability of supporting sequences that do not start and end at the 
same position and with the capability of masking the sequences.
I'm implementing the __getitem__ method.
When I request a column I get for all sequences a int slice and I return the 
result of adding them all. I could solve the problem as you suggest. The 
problem is that this Contig class can work also with Seqs and strs (to 
simplify its use when we don't need a full SeqRecord). If SeqRecord behaves 
more like a Seq or a str I wouldn't need to check for the special SeqRecord 
case in the Contig.__getitem__ method.
Best regards,

-- 
Jose M. Blanca Postigo
Instituto Universitario de Conservacion y
Mejora de la Agrodiversidad Valenciana (COMAV)
Universidad Politecnica de Valencia (UPV)
Edificio CPI (Ciudad Politecnica de la Innovacion), 8E
46022 Valencia (SPAIN)
Tlf.:+34-96-3877000 (ext 88473)




More information about the Biopython-dev mailing list