Пример #1
0
parser.add_argument('-f', '--infile', help='input file', type=fpath, default='.')
parser.add_argument('-m', '--model', help='model', type=str, default='GTR')
parser.add_argument('-n', '--ncat', help='number of categories of gamma-distributed rate variation', type=int, default=4)
parser.add_argument('-d', '--datatype', help='datatype = nt (nucleotide), or aa (amino acid)', type=str, default='nt')
args = vars(parser.parse_args())

infile = args['infile'] + os.environ['LSB_JOBINDEX']
model = args['model']
datatype = args['datatype']
ncat = args['ncat']

if not os.path.isfile(infile):
    print 'Input file not found:\n{0}'.format(os.path.abspath(infile))
    sys.exit(0)

with open(infile) as file:
    target = os.path.abspath(file.read())

if not os.path.isfile(target):
    print 'Target file not found:\n{0}'.format(os.path.abspath(target))
    sys.exit(0)

print target
parent_dir = os.path.dirname(target)
name = getname(target)

record = TCSeqRec(target, file_format='phylip', name=name)
record.get_phyml_tree(model=model,ncat=ncat,datatype=datatype)

cPickle.dump(record, open('{0}/{1}.pickle'.format(parent_dir, name),'w'))
Пример #2
0
infile = args['infile']
if index:
    infile += index

if not infile[-1].isdigit():
    print '{0} is not correct'.format(infile)
    sys.exit(1)

if not os.path.isfile(infile):
    print 'Input file not found:\n{0}'.format(os.path.abspath(infile))
    sys.exit(0)

with open(infile) as file:
    target = os.path.abspath(file.read())

if not os.path.isfile(target):
    print 'Target file not found:\n{0}'.format(os.path.abspath(target))
    sys.exit(2)

print target
parent_dir = os.path.dirname(target)
name = getname(target)

record = TCSeqRec(target, file_format='phylip', name=name)
if not os.path.isfile('{0}/{1}.ml.pickle'.format(parent_dir, name)):
    record.get_phyml_tree(model='GTR', ncat=4, datatype='nt', tmpdir=tmpdir)
    cPickle.dump(
        record, open('{0}/{1}.ml.pickle'.format(parent_dir, name), 'w')
    )  # In future let's just pickle trees; sequences already stored on disk
Пример #3
0
except:
    tmpdir = '/tmp'

infile = args['infile']
if index:
    infile += index

if not infile[-1].isdigit():
    print '{0} is not correct'.format(infile)
    sys.exit(1)

if not os.path.isfile(infile):
    print 'Input file not found:\n{0}'.format(os.path.abspath(infile))
    sys.exit(0)

with open(infile) as file:
    target = os.path.abspath(file.read())

if not os.path.isfile(target):
    print 'Target file not found:\n{0}'.format(os.path.abspath(target))
    sys.exit(2)

print target
parent_dir = os.path.dirname(target)
name = getname(target)

record = TCSeqRec(target, file_format='phylip', name=name)
if not os.path.isfile('{0}/{1}.ml.pickle'.format(parent_dir, name)):
    record.get_phyml_tree(model='GTR',ncat=4,datatype='nt', tmpdir=tmpdir)
    cPickle.dump(record, open('{0}/{1}.ml.pickle'.format(parent_dir, name),'w')) # In future let's just pickle trees; sequences already stored on disk
Пример #4
0
                    '--datatype',
                    help='datatype = nt (nucleotide), or aa (amino acid)',
                    type=str,
                    default='nt')
args = vars(parser.parse_args())

infile = args['infile'] + os.environ['LSB_JOBINDEX']
model = args['model']
datatype = args['datatype']
ncat = args['ncat']

if not os.path.isfile(infile):
    print 'Input file not found:\n{0}'.format(os.path.abspath(infile))
    sys.exit(0)

with open(infile) as file:
    target = os.path.abspath(file.read())

if not os.path.isfile(target):
    print 'Target file not found:\n{0}'.format(os.path.abspath(target))
    sys.exit(0)

print target
parent_dir = os.path.dirname(target)
name = getname(target)

record = TCSeqRec(target, file_format='phylip', name=name)
record.get_phyml_tree(model=model, ncat=ncat, datatype=datatype)

cPickle.dump(record, open('{0}/{1}.pickle'.format(parent_dir, name), 'w'))