Commit 47d48676 authored by Eric Coissac's avatar Eric Coissac

--no commit message

--no commit message
parent c7cc64ea
......@@ -29,7 +29,8 @@ default_config = {
'loglevel' : 'INFO',
'outputfilename' : None,
'back' : None,
'seeds' : None
'seeds' : None,
'progress' : True
}
}
......@@ -123,7 +124,12 @@ def buildArgumentParser():
parser.add_argument('--no-log', dest='orgasm:log',
action='store_false',
default=None,
help='Create a logfile for the assembling')
help='Do not create a logfile for the assembling')
parser.add_argument('--no-progress', dest='orgasm:progress',
action='store_false',
default=None,
help='Do not print the progress bar during assembling')
subparsers = parser.add_subparsers(title='subcommands',
description='valid subcommands',
......@@ -166,6 +172,11 @@ def buildDefaultConfiguration():
def getConfiguration():
global default_config
if '__done__' in default_config:
return default_config
parser = buildArgumentParser()
options = vars(parser.parse_args())
......@@ -183,6 +194,8 @@ def getConfiguration():
config['orgasm']['outputfilename']=config['orgasm']['indexfilename']
getLogger(config)
config['__done__']=True
return config
......
......@@ -25,6 +25,7 @@ default_config = { 'minread' : None,
'smallbranches' : None,
'lowcomplexity' : False,
'snp' : False,
'assmax' : 500000
}
def addOptions(parser):
......@@ -64,6 +65,12 @@ def addOptions(parser):
help='minimum occurrences of an extension to '
'keep it. [default: %(default)d]')
parser.add_argument('--assmax', dest='buildgraph:assmax',
type=int,
action='store',
default=None,
help='maximum base pair assembled')
parser.add_argument('--minoverlap', dest='buildgraph:minoverlap',
type=int,
action='store',
......@@ -124,10 +131,13 @@ def estimateMinRead(index,minoverlap,coverage):
def run(config):
logger=config['orgasm']['logger']
progress = config['orgasm']['progress']
output = config['orgasm']['outputfilename']
lowfilter=not config['buildgraph']['lowcomplexity']
coverageset=config['buildgraph']['coverage'] is not None
snp=config['buildgraph']['snp']
assmax = config['buildgraph']['assmax']*2
r = getIndex(config)
p = getProbes(config)
......@@ -182,7 +192,9 @@ def run(config):
lowfilter=lowfilter,
maxjump=0,
cycle=1,
nodeLimit=30000)
nodeLimit=30000,
progress=progress,
logger=logger)
# Clean small unsuccessful extensions
asm.cleanDeadBranches(maxlength=10)
......@@ -232,7 +244,10 @@ def run(config):
minoverlap=minoverlap,
lowfilter=lowfilter,
maxjump=0,
cycle=1)
cycle=1,
nodeLimit=assmax,
progress=progress,
logger=logger)
# Clean small unsuccessful extensions
asm.cleanDeadBranches(maxlength=10)
......
......@@ -30,7 +30,9 @@ def tango(self,seeds,
minread=10, minratio=0.1,
mincov=1, minoverlap=40,
lowfilter=True,maxjump=0,restrict=None,
cycle=1, nodeLimit=1000000):
cycle=1, nodeLimit=1000000,
progress=True,
logger=None):
'''
the :py:func:`~organsm.tango.tango` function is the main assembling function. It extends selected
seeds to produce the assembled sequence.
......@@ -82,7 +84,7 @@ def tango(self,seeds,
delta=0
wheel= '|/-\\'
lastprint=-1
# a direct pointer to the read index
index = self.index
......@@ -149,9 +151,25 @@ def tango(self,seeds,
if growing > +0.01 and delta < 40:
delta+=1
lastseeds=[1]*1000
print >>sys.stderr,b"%s : %d bp [%4.1f%% fake reads; Stack size: %8d / %6.2f %d Gene: %s \r" % (wheel[(icycle/10) % 4],len(graph)/2,float(fake)/(len(graph)+1)*200.,len(seeds),growing,delta,lastgene),
#print >>sys.stderr,b"Cycle : %8d (%d nodes) Waiting points : %8d " % (cycle,len(graph),len(seeds))
if progress:
print >>sys.stderr,b"%s : %d bp [%4.1f%% fake reads; Stack size: %8d / %6.2f %d Gene: %s \r" % (wheel[(icycle/10) % 4],
len(graph)/2,
float(fake)/(len(graph)+1)*200.,
len(seeds),
growing,
delta,
lastgene),
if logger is not None and len(graph)!=lastprint and len(graph) % 20000==0:
lastprint=len(graph)
logger.info(b"%d bp [%4.1f%% fake reads; Stack size: %8d / %6.2f %d Gene: %s " % (len(graph)/2,
float(fake)/(len(graph)+1)*200.,
len(seeds),
growing,
delta,
lastgene))
#
# We add the read into the graph
......
......@@ -41,7 +41,7 @@ static void PrintHelp()
PP " <index>.opx : contains read pairing data\n\n");
PP " The assembler will need all these file to process assembling\n\n");
PP "-M : If specified the count in million of reads to index\n\n");
PP "-l : read length to consider\n\n");
PP "-l : read length to consider (must be an odd length)\n\n");
PP "-h : [H]elp - print <this> help\n\n");
PP "\n");
PP "------------------------------------------\n");
......@@ -158,6 +158,13 @@ if (errflag)
#define MAXREAD 2000000000
/* If the read length is even then shorten it by one base */
if ((readLength & 1) ==0)
{
readLength--;
fprintf(stderr,"Read length adjusted to %d",readLength);
}
reads = buildIndex(forwardFileName,reverseFileName,indexfiles,95,toread,MAXREAD,readLength);
freeBuffer(reads);
......
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