Commit 49104d21 by Eric Coissac

--no commit message

parent f643f507
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -120,9 +120,9 @@ def getLogger(config):
def buildArgumentParser():
parser = argparse.ArgumentParser()
parser.add_argument('--log', dest='orgasm:log',
action='store_true',
default=False,
parser.add_argument('--no-log', dest='orgasm:log',
action='store_false',
default=None,
help='Create a logfile for the assembling')
subparsers = parser.add_subparsers(title='subcommands',
......@@ -189,10 +189,7 @@ def getConfiguration():
if __name__ =="__main__":
config = getConfiguration()
print config
config = getConfiguration()
config['orgasm']['module'].run(config)
......@@ -15,7 +15,7 @@ import sys
__title__="Build the initial assembling graph"
default_config = { 'minread' : None,
'coverage' : None,
......@@ -173,7 +173,7 @@ def run(config):
# to obtain a better coverage estimation
#
##########################
if config['buildgraph']['minread'] is None:
if config['buildgraph']['minread'] is None and not coverageset:
# Run the first assembling pass
a = tango(asm,s,mincov=minread, # @UnusedVariable
......@@ -311,6 +311,7 @@ def run(config):
cmincov=2,
emincov=int(coverage/4),
gmincov=int(coverage/4),
lowfilter=lowfilter,
snp=snp)
print >>sys.stderr
......@@ -357,7 +358,7 @@ def run(config):
cg = asm.compactAssembling(verbose=False)
score,length,ecoverage = coverageEstimate(asm,x,r) # @UnusedVariable
if coverageset:
if not coverageset:
coverage=ecoverage
if snp:
......
'''
Created on 28 sept. 2014
@author: coissac
'''
from orgasm import getIndex, getSeeds
from orgasm.tango import restoreGraph, estimateFragmentLength, genesincontig,\
scaffold, path2fasta
__title__="Build a fasta file from a path across the assembling graph"
default_config = {
}
def addOptions(parser):
parser.add_argument(dest='orgasm:indexfilename', metavar='<index>',
help='index root filename (produced by the orgasmi command)')
parser.add_argument(dest='orgasm:outputfilename', metavar='<output>',
nargs='?',
default=None,
help='output prefix' )
parser.add_argument('--path', dest='path:path',
action='store',
metavar='<edgeid>',
type=int,
nargs='+',
required=True,
default=None,
help='A list of edge id separated by space add -- at the end of the path')
parser.add_argument('--back', dest='orgasm:back',
metavar='<insert size>',
type=int,
action='store',
default=None,
help='the number of bases taken at the end of '
'contigs to jump with pared-ends [default: <estimated>]')
def run(config):
logger=config['orgasm']['logger']
output = config['orgasm']['outputfilename']
r = getIndex(config)
x = getSeeds(r,None,config)
asm = restoreGraph(output+'.oax',r,x)
logger.info("Evaluate fragment length")
meanlength,sdlength = estimateFragmentLength(asm)
if meanlength is not None:
logger.info("Fragment length estimated : %f pb (sd: %f)" % (meanlength,sdlength))
if config['orgasm']['back'] is not None:
back = config['orgasm']['back']
elif config['orgasm']['back'] is None and meanlength is not None:
back = int(meanlength + 4 * sdlength)
if back > 500:
back=500
else:
back = 300
cg = asm.compactAssembling(verbose=False)
genesincontig(cg,r,x)
scaffold(asm,cg,minlink=5,back=int(back),addConnectedLink=False)
fastaout = open(output+".fasta","w")
logger.info("Print the result as a fasta file")
c=1
path = config['path']['path']
logger.info('Built path : %s' % str(path))
fa = path2fasta(asm,cg,path,
identifier="Seq_%d" % c,
back=back,
minlink=5)
print >>fastaout,fa
print >>open(output +'.path.gml','w'),cg.gml()
......@@ -93,6 +93,6 @@ def run(config):
print >>fastaout,fa
c+=1
print >>open(output +'path.gml','w'),cg.gml()
print >>open(output +'.path.gml','w'),cg.gml()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment