Commit ba728eb4 authored by Eric Coissac's avatar Eric Coissac

--no commit message

--no commit message
parent 517ebd77
......@@ -22,10 +22,8 @@ def getLogger(config):
rootlogger.addHandler(stderrHandler)
logfilename = config.logfilename
if logfilename is not None:
fileHandler = logging.FileHandler(logfilename)
if config.log:
fileHandler = logging.FileHandler("%s.log" % config.outputname)
fileHandler.setFormatter(logFormatter)
rootlogger.addHandler(fileHandler)
......@@ -72,12 +70,12 @@ class Config:
return self._logger
@property
def logfilename(self):
def log(self):
"""
The file name of the log file. If None then logs are not saved in a file
"""
logfilename = self._getvalue('logfilename','General','logfilename',str)
return logfilename
log = self._getvalue('log','General','log',bool)
return log
@property
def loglevel(self):
......@@ -197,6 +195,7 @@ def defaultConfiguration(options=None):
config.optionxform=str
config.add_section('General')
config.set('General', 'log', 'False')
config.set('General', 'loglevel', 'INFO')
config.add_section('Data')
......@@ -224,6 +223,7 @@ def defaultConfiguration(options=None):
def getConfiguration(options=None):
dconfig = defaultConfiguration()
configFile = getConfigFile(options)
......@@ -231,29 +231,29 @@ def getConfiguration(options=None):
dconfig.read(configFile)
if options is not None:
if options.minread is not None:
if hasattr(options,'minread') and options.minread is not None:
dconfig.set('Extension', 'minread', str(options.minread))
if options.minratio is not None:
if hasattr(options,'minratio') and options.minratio is not None:
dconfig.set('Extension', 'minratio', str(options.minratio))
if options.mincov is not None:
if hasattr(options,'mincov') and options.mincov is not None:
dconfig.set('Extension', 'mincov', str(options.mincov))
if options.minoverlap is not None:
if hasattr(options,'minoverlap') and options.minoverlap is not None:
dconfig.set('Extension', 'minoverlap', str(options.minoverlap))
if options.smallbranches is not None:
if hasattr(options,'smallbranches') and options.smallbranches is not None:
dconfig.set('Cleaning', 'smallbranches', str(options.smallbranches))
if options.outputFilename is None:
if hasattr(options,'outputFilename') and options.outputFilename is None:
options.outputFilename = options.indexFilename
dconfig.set('Data', 'index', options.indexFilename)
dconfig.set('Data', 'output', options.outputFilename)
if options.logfile is not None:
dconfig.set('General', 'logfilename', options.logfile)
if options.log:
dconfig.set('General', 'log', True)
if options.back is not None:
dconfig.set('Gap-filling', 'back', str(options.back))
......
......@@ -2,28 +2,28 @@ from fakereads cimport FakeReads
cdef extern from "inttypes.h":
ctypedef int int32_t
ctypedef int int32_t
ctypedef unsigned int uint32_t
cdef extern from "orgasm.h":
ctypedef struct buffer_t:
size_t readSize # Size of one read in base pair
size_t recordSize # Size in bytes of one compressed read
char* records # the start of the first record [0].
size_t readCount # count of reads. One pair of reads counts for 2
uint32_t* order1 # a pointer used to point on a int array indicating an order
# over the records.
uint32_t* order2 # a pointer used to point on a int array indicating an order
# over the records.
size_t readSize # Size of one read in base pair
size_t recordSize # Size in bytes of one compressed read
char* records # the start of the first record [0].
size_t readCount # count of reads. One pair of reads counts for 2
uint32_t* order1 # a pointer used to point on a int array indicating an order
# over the records. @IndentOk
uint32_t* order2 # a pointer used to point on a int array indicating an order
# over the records.
uint32_t* complement
ctypedef unsigned char* pnuc
cdef class Index:
cdef buffer_t* _index
cdef FakeReads _fakes
cpdef bint contains(self, bytes word)
cpdef int count(self,word)
cpdef int len(self)
......@@ -31,11 +31,11 @@ cdef class Index:
cpdef dict getExtensions(self, bytes word)
cpdef int getReadSize(self)
cpdef tuple getReadIds(self, bytes seq)
cpdef tuple getIds(self, int32_t id)
cpdef tuple getIds(self, int32_t id)
cpdef int32_t getPairedRead(self, int32_t id)
cpdef tuple normalizedPairedEndsReads(self, int32_t id)
cpdef lookForSeeds(self, dict proteins, int kup=?, int mincov=?)
cpdef dict checkedExtensions(self, bytes probe,
int minread=?,
double minratio=?,
......@@ -45,4 +45,3 @@ cdef class Index:
bint lowfilter=?,
object restrict=?,
bint exact=?)
\ No newline at end of file
This diff is collapsed.
......@@ -57,8 +57,8 @@ if __name__ == '__main__':
parser.add_argument('--smallbranches', dest='smallbranches', type=int, action='store', default=None, help='maximum length of the branches to cut during the cleaning process [default: <estimated>]')
parser.add_argument('--lowcomplexity', dest='lowcomplexity', action='store_true', default=False, help='Use also low complexity probes')
parser.add_argument('--back', dest='back', type=int, action='store', default=None, help='the number of bases taken at the end of contigs to jump with pared-ends [default: <estimated>]')
parser.add_argument('--snp', dest='snp', action='store_false', default=True, help='desactivate the SNP clearing mode')
parser.add_argument('--logfile', dest='logfile', action='store', default=None,type=str, help='Create a logfile for the assembling')
parser.add_argument('--snp', dest='snp', action='store_true', default=False, help='desactivate the SNP clearing mode')
parser.add_argument('--log', dest='log', action='store_true', default=False, help='Create a logfile for the assembling')
parser.add_argument('--seeds', dest ='seeds', metavar='seeds', default=None, type=str, help='protein seeds; either a file containing seeds proteic sequences or internal set of seeds among %s' % str(filter(lambda s: s.startswith('prot'),dir(orgasm.samples))) )
#parser.add_argument('--maxjump', dest='maxjump', type=int, action='store', default=1, help='COunt of pair end jump by extension branch')
......@@ -114,7 +114,7 @@ if __name__ == '__main__':
if config.minread is None:
# Run the first assembling pass
a = tango(asm,s,mincov=config.mincov,
a = tango(asm,s,mincov=minread, # config.mincov,
minread=minread,
minoverlap=minoverlap,
lowfilter=not config.lowcomplexity,
......@@ -154,7 +154,7 @@ if __name__ == '__main__':
#############################################
# Run the first assembling pass
a = tango(asm,s,mincov=config.mincov,
a = tango(asm,s,mincov=minread, #config.mincov,
minread=minread,
minoverlap=minoverlap,
lowfilter=not config.lowcomplexity,
......@@ -227,7 +227,8 @@ if __name__ == '__main__':
minread=minread,
maxjump=0,
minoverlap=minoverlap,
cmincov=0,
cmincov=2,
emincov=minread,
gmincov=int(coverage/4),
snp=args.snp)
......
......@@ -12,9 +12,11 @@
#include <stdio.h>
#include <sys/types.h>
//#include <malloc.h>
#include <errno.h>
void *realloc(void *ptr, size_t size);
void *malloc(size_t size);
#define MAXFILES 20
typedef struct {
......@@ -30,7 +32,7 @@ fgetln(FILE *fd, size_t *len)
{
int idx;
int c, lnsize;
int newest;
// int newest;
/* we want to do fgetln, eh? Check to see if all the variables
* are okay first (don't want to waste space if the file is bad
......
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