validate_genelocustatsoptions ) from abgpgenelocusdirectory import AbgpGeneLocusDirectory from lib_sequencerepetitiveness import annotatedproteinsequencerepetitivenesscheck # construct the command line option parser parser = abgpoptparser() genelocustatsoptions(parser) parser.remove_option('--explain') # parse the command line & validate (OPTIONS, args) = parser.parse_args() validate_genelocustatsoptions(parser,OPTIONS) # change directory to the one specified by optparse option os.chdir(OPTIONS.DIRECTORY) locus = AbgpGeneLocusDirectory(OPTIONS.DIRECTORY) input = locus.toinputdict() # do geneconfirmation input,gene_status = geneconfirmation(input,verbose=True) # do a protein sequence repetitiveness check IS_REPETITIVE = annotatedproteinsequencerepetitivenesscheck(input) # do a check on tiny/small exons HAS_SMALL_OR_TINY_EXONS = annotatedgeneexonsizeevaluation(input) # do check on noncannocical splice sites for org in input.keys(): status, warnings = confirmcanonicalsplicesites(input[org]['genomeseq'], input[org]['gff-gene'],exon_fmethod=GFF_CDS_FMETHOD,verbose=False)
thisoption = parser.get_option('--dirwithloci') thisoption.help = 'give statistics for all the AbfgpGeneLocusDirectories in this --dirwithloci' thisoption = parser.get_option('--filewithloci') thisoption.help = 'give statistics for all the AbfgpGeneLocusDirectories listed in this --filewithloci' (OPTIONS, args) = parser.parse_args() OPTIONS.target = None # dummy option validate_abgpinputoptions(parser,OPTIONS) validate_abgpoptions(parser,OPTIONS) ################################################################################ ################################################################################ if OPTIONS.loci: input = {} # input data structure, empty for locusdir in OPTIONS.loci: locus = AbgpGeneLocusDirectory(locusdir) locuskey = locus._create_auto_key( identifier2organism=ABGP_LOCUS_IDENTIFIER2ORGANISM_MAPPING ) if input.has_key(locuskey): for suffix in list('abcdefghijklmnopqrstuvwxyz'): if not input.has_key(locuskey+suffix): input.update( locus.toinputdict(key=locuskey+suffix) ) break else: input.update( locus.toinputdict(key=locuskey) ) else: print "Exception.NoAbgpGeneLocusDirectoriesProvided" print "" parser.print_help() sysexit()