All checkmarks (red, green) are converted to positive states in Nexus
Also, traits with only ? are coded ?, but if they have another state,
then ? is interpreted as a positive state.
+ For states, it uses the categories as state names, and the last field
+ as the state value. Ecology:Color:Red; Ecology:Color:Blue
+ becomes character Ecology:Color, with value names Red and Blue = states 1 and 2
Version 1.1 - Get input name from sys.argv and
output *only* the NEXUS info via stdout
CommentString = "Created with version %s of LucidConvert on %s from Lucid file %s" %(VERSION, asctime(), FileName)
- #### Lucid exports two (three) phantom taxa at start of file, at least in my examples. skip them...
- # skip first two taxa??
+ # There is a blank before the first comma, so skip that one...
+ # CHECK the output of first and last species exported
SpeciesList = MyStream.next()[1:]
print >> sys.stderr, "CharList", CharList
- for Char in [ 'Size: Longest axis length (mm) Tentacles not included', 'Described',
- 'Tentacles:Shape of Tentacle Bulbs (TP)','Body:Papillae Type',
- 'Body:Comb Row Extent (STCR, as % relative to body length, including lobes)']:
print >> sys.stderr, Char
- for TaxID in range(len(StateList)):
- #print SpeciesList[TaxID],"\t",TaxonTraits[(TaxID,Char)]
+ for TaxID in range(len(StateList)):
+ #print SpeciesList[TaxID],"\t",TaxonTraits[(TaxID,Char)]
print >> sys.stderr, TaxID, SpeciesList[TaxID], "\t", TaxonTraits[(TaxID,Char)], "\t", ListToNexusSet(TaxonTraits[(TaxID,Char)])
+ # DONE READING IN FILE, TIME TO WRITE OUT...
SpeciesSub = ["'" + x.replace(" ","_") +"'" for x in SpeciesList]