Mercurial > repos > iuc > nanocompore_db
comparison NanocomporeDB_process.py @ 2:d193d0e411bd draft default tip
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/nanocompore commit e0d4688a59e6eeba33adcfe803ac43d0bc2863e7"
| author | iuc |
|---|---|
| date | Wed, 01 Sep 2021 07:47:15 +0000 |
| parents | 97a6b3f9a98d |
| children |
comparison
equal
deleted
inserted
replaced
| 1:97a6b3f9a98d | 2:d193d0e411bd |
|---|---|
| 38 parser.add_argument('--pvalue-types', type=str, | 38 parser.add_argument('--pvalue-types', type=str, |
| 39 default='GMM_logit_pvalue,KS_dwell_pvalue,KS_intensity_pvalue', | 39 default='GMM_logit_pvalue,KS_dwell_pvalue,KS_intensity_pvalue', |
| 40 help='path to the annotations') | 40 help='path to the annotations') |
| 41 parser.add_argument('--bedgraph', action="store_true", | 41 parser.add_argument('--bedgraph', action="store_true", |
| 42 help='write output in BEDGRAPH format instead of BED') | 42 help='write output in BEDGRAPH format instead of BED') |
| 43 parser.add_argument('--pvalue-threshold', default=1.0, | 43 parser.add_argument('--pvalue-threshold', type=float, default=1.0, |
| 44 help='Maximum reported p-value.') | 44 help='Maximum reported p-value.') |
| 45 parser.add_argument('--out-dir', default="./", type=is_valid_directory, | 45 parser.add_argument('--out-dir', default="./", type=is_valid_directory, |
| 46 help='path the plotting output directory.') | 46 help='path the plotting output directory.') |
| 47 | 47 |
| 48 args = parser.parse_args() | 48 args = parser.parse_args() |
| 50 db = SampCompDB(args.db_path, fasta_fn=args.ref_fasta, | 50 db = SampCompDB(args.db_path, fasta_fn=args.ref_fasta, |
| 51 bed_fn=args.annotation_bed) | 51 bed_fn=args.annotation_bed) |
| 52 print(db) | 52 print(db) |
| 53 print("DB read ids:", db.ref_id_list) | 53 print("DB read ids:", db.ref_id_list) |
| 54 | 54 |
| 55 if args.bedgraph: | |
| 56 file_ext = 'bedgraph' | |
| 57 else: | |
| 58 file_ext = 'bed' | |
| 59 | |
| 55 if args.annotation_bed: | 60 if args.annotation_bed: |
| 56 for pt in args.pvalue_types.split(','): | 61 for pt in args.pvalue_types.split(','): |
| 57 print("bedgraph output for p-value type:", pt) | 62 out_path = '{}/{}.{}'.format(args.out_dir, pt, file_ext) |
| 58 db.save_to_bed(output_fn='{}/{}.bedgraph'.format(args.out_dir, pt), | 63 print("%s output for p-value type:" % out_path, pt) |
| 64 db.save_to_bed(output_fn=out_path, | |
| 59 pvalue_field=pt, pvalue_thr=args.pvalue_threshold, | 65 pvalue_field=pt, pvalue_thr=args.pvalue_threshold, |
| 60 bedgraph=args.bedgraph) | 66 bedgraph=args.bedgraph) |
