Example #1
0
def main():
    parser = argparse.ArgumentParser('CRAMtools bam-style-index')

    # Logging flags.
    parser.add_argument('-d', '--debug',
        action = 'store_const',
        const = logging.DEBUG,
        dest = 'level',
        help = 'Enable debug logging.',
    )
    parser.set_defaults(level = logging.INFO)

    # Required flags.

    parser.add_argument('-r', '--reference_fasta_path',
                        required = False,
                        help = 'Reference fasta path.',
    )
    parser.add_argument('-b', '--cram_path',
                        required = False,
                        action="append",
                        help = 'Source cram path.',
    )
    parser.add_argument('-u', '--uuid',
                        required = True,
                        help = 'analysis_id string',
    )
    parser.add_argument('--tool_name',
                        required = True,
                        help = 'cramtools'
    )

    args = parser.parse_args()
    tool_name = args.tool_name
    uuid = args.uuid


    logger = pipe_util.setup_logging(tool_name, args, uuid)
    engine = pipe_util.setup_db(uuid)

    hostname = os.uname()[1]
    logger.info('hostname=%s' % hostname)


    if tool_name == 'index':
        cram_path = pipe_util.get_param(args, 'cram_path')
        reference_fasta_path = pipe_util.get_param(args, 'reference_fasta_path')      
        index(uuid, cram_path, reference_fasta_path, engine, logger)
    else:
        sys.exit('No recognized tool was selected')
Example #2
0
    def remove_chain(self, chain):
        chain_idx = tools.index(self.chain_list, chain)

        del self.chain_list[chain_idx]
        self.number_of_chains -= 1
Example #3
0
import pickle
import numpy as np
import nn
import tools as tl
import os
import sys
import pm
import matplotlib.pyplot as plt

# index
index = tl.index('data/mnist/index.npy')
cwd = str(os.getcwd())
os.system('cat ' + str(sys.argv[0]) + ' >> data/mnist/' + str(sys.argv[0]) +
          str(index) + '.py')
print('mnist:- index = {}'.format(index))

#loading the MNIST data
test = pickle.load(open('data/mnist/test', 'rb'))
train = pickle.load(open('data/mnist/train', 'rb'))
print('MNIST data loaded')

#reshaping
tni = []
tti = []
ttl = []
tnl = []
for a, b in zip(train[0], test[0]):
    a = np.reshape(a, [1, 28, 28])
    b = np.reshape(b, [1, 28, 28])
    tni.append(a)
    tti.append(b)