[Biopython] Combine nexus files but not concatenating them

Frank Kauff fkauff at biologie.uni-kl.de
Mon Oct 19 09:44:39 EDT 2009


Hi all,

unfortunately, morphological data types and mixed data types are 
curretnly unsupported. For no special reason - I just never bothered to 
implement them... I think it's not trivial, though, because one would 
have to store the data type for each individual character in some way, 
which would probably mean to significantly change the data structure 
that is currently used to hold the alignment data...

With regard to splitting up a nexus file - yes, if there is a data 
partition defined, the individual subdivisions can be saved as 
individual nexus files with

mynexusinstance.write_nexus_data_partitions(charpartition='name_of_partition')

Please see the method for further details of customization. Otherwise, 
one could save the characters defined in a character set as nexus using

mynexusinstance.write_nexus_data(filename'charsetxy.nex',exclude=[c for 
c in range(mynexusinstance.nchar) if c not in 
mynexusinstance.charsets['name_of_charset_i_want_to_save']])

Cheers,
Frank


On 10/08/2009 10:54 AM, Peter wrote:
> On Thu, Oct 8, 2009 at 12:23 AM, Denzel Li<denzel.dz.li at gmail.com>  wrote:
>    
>> Hi Peter:
>> Regarding the Nexus datatype supported in Bio:Nexus:Nexus, I mean nexus like
>> the following, where the datatype is a "mixing" of "standard" and "DNA".
>> According to the function Bio:Nexus:Nexus._format (line 696), these
>> datatypes are not supported yet. I am just wondering does the team has the
>> plan to support these data types.
>>      
> Oh right - in in your example, the digits encode morphology, but they could
> also be phenotypes, or some other characteristic like gene copy number.
>
> As to Bio.Nexus supporting this, hopefully Frank or Cymon can comment.
>
> If Bio.Nexus did support this, then from the Bio.AlignIO point of view, with
> the current object structure we'd have to use a sequence object (holding
> both the digits, and the DNA) for the sequence strings (e.g. for s1 in your
> example, Seq("10010ACGT")) with a generic single letter alphabet. This
> would lose the fact that the first five characters are digits, but the rest are
> DNA. This isn't ideal, and would probably cause trouble for Nexus output
> (writing such alignments).
>
> Would you want to try and deal with such "mixed" alignments via the
> Bio.AlignIO interface?
>
> Peter
>
>    

-- 
J-Prof. Dr. Frank Kauff
Molecular Phylogenetics
FB Biologie, 13/276
TU Kaiserslautern
Postfach 3049
67653 Kaiserslautern

Tel. +49 (0)631 205-2562
Fax. +49 (0)631 205-2998
email: fkauff at biologie.uni-kl.de
skype: frank.kauff



More information about the Biopython mailing list