def fetch_input(self): hostname=self.param('hostname') username=self.param('username') db=self.param('db') port=self.param('port') pwd=self.param('pwd') reseqdb = ReseqTrackDB(host=hostname,user=username,port=port,pwd=pwd,db=db) self.param('reseqdb', reseqdb)
def reseqtrackdb_object(): '''Returns an object''' hostname = pytest.config.getoption("--hostname") username = pytest.config.getoption("--username") port = pytest.config.getoption("--port") pwd = pytest.config.getoption("--pwd") db = pytest.config.getoption("--db") reseqtrackdb_object = ReseqTrackDB(host=hostname, user=username, port=port, pwd=pwd, db=db) return reseqtrackdb_object
fh.setFormatter(formatter) # add handler to logger object logger.addHandler(fh) logger.info("Program started") hostname = args.hostname username = args.username db = args.db port = args.port pwd = args.pwd reseqdb = ReseqTrackDB(host=hostname, user=username, port=port, pwd=pwd, db=db) with open(args.ifile) as f: for p in f: p = p.rstrip("\n") filename = os.path.basename(p) logger.info("Changing file type for %s" % filename) fileO = reseqdb.fetch_file_by_filename(filename) old_type = fileO.type newtype = "" if old_type == "LC_BAM" or old_type == "EX_BAM": newtype = args.newtype
#RESEQTRACK DB conn params parser.add_argument('--hostname', type=str, required=True, help='Hostname for ReseqTrack DB' ) parser.add_argument('--username', type=str, required=True, help='User for ReseqTrack DB' ) parser.add_argument('--port', type=int, required=True, help='Port number in the ReseqTrack DB' ) parser.add_argument('--pwd', type=str, help='PWD for the ReseqTrack DB' ) parser.add_argument('--db', type=str, required=True, help='DB name in the ReseqTrack DB' ) #files that will be analyzed parser.add_argument('-vcfl','--vcflist', nargs='+', help='<Required> List of VCFs to analyze', required=True) parser.add_argument('-cnames','--columnames', nargs='+', help='<Required> List of columns used in the .csv and .png files', required=True) parser.add_argument('--chros_f', type=str, required=True, help='File with chros' ) parser.add_argument('--outprefix', type=str, required=True, help='Prefix for output files' ) args = parser.parse_args() reseqtrackdb_object=ReseqTrackDB(host=args.hostname,user=args.username,port=args.port,pwd=args.pwd,db=args.db) def get_annotation(attr_list,dict_str,pattern): patt = re.compile( pattern ) patt1 = re.compile('^STATS_.*(chr.+)_filt' ) for a in attr_list: match = patt.match( a.name ) match1 = patt1.match( a.name ) if match: if match1: dict_str[match1.group(1)].append(a.value) else: raise Exception("Error matching the attribute name") return dict_str
fh.setFormatter(formatter) # add handler to logger object logger.addHandler(fh) logger.info("Program started") hostname = args.hostname username = args.username db = args.db port = args.port pwd = args.pwd reseqdb = ReseqTrackDB(host=hostname, user=username, port=port, pwd=pwd, db=db) l1 = get_files_by_type(reseqdb, args.ftype_1) l2 = get_files_by_type(reseqdb, args.ftype_2) l3 = [] if args.ftype_3: l3 = get_files_by_type(reseqdb, args.ftype_3) others_ids = list(set(l1 + l2 + l3)) new_c = Collection(name=args.collection_name, type=args.collection_type, others_dbIDs=others_ids,
parser.add_argument('--size', type=str, required=True, help='Size for font in plots. i.e. 50') args = parser.parse_args() hostname = args.hostname username = args.username db = args.db port = args.port pwd = args.pwd reseqtrackdb_object = ReseqTrackDB(host=hostname, user=username, port=port, pwd=pwd, db=db) vcf_f = reseqtrackdb_object.fetch_file_by_url(args.ifile) attrbs = reseqtrackdb_object.fetch_attributes_by_other_id(vcf_f.dbID) def rec_dd(): return defaultdict(rec_dd) #valid attributes, edit it to modify the order of columns valid_attrb = ['VAR_SENSITIVITY', 'VAR_SPECIFICITY', 'GENOTYPE_CONCORDANCE'] x = rec_dd()