def main( sample_config: str = typer.Argument(...), summary_report: str = typer.Argument(...), output_prefix: str = typer.Argument(...), min_sample: int = typer.Option( 1, "-S", help="Minimum number of samples as evidence (default: 1)"), min_transcript: int = typer.Option( 2, "-T", help="Minimum number of transcripts as evidence (default: 2)"), # parser.add_argument("-C", "--accept_all_canonical", action="store_true", default=False, help="Accept all canonical jucntions (default: false)") scrubbed_junction_file: Optional[Union[str, Path]] = typer.Option( None, help= "Scrubbed junction bed --- if given, directly use it to scrub GFFs."), version: bool = typer.Option( None, "--version", callback=version_callback, is_eager=True, help="Prints the version of the SQANTI3 package.", ), ): ( sample_dirs, sample_names, group_filename, gff_filename, count_filename, fastq_filename, ) = sp.read_config(sample_config) report_filename = summary_report if scrubbed_junction_file is None: output_filename = f"{output_prefix}.scrubbed.junction.bed" tree = scrub_junctions(report_filename, output_filename, min_sample, min_transcript, True) logger.info(f"Scrubbed junction written to: {output_filename}") else: output_filename = scrubbed_junction_file logger.info(f"Reading scrubbed junction file: {output_filename}") tree = read_scrubbed_junction_to_tree(output_filename) scrub_sample_GFFs( sample_dirs, gff_filename, count_filename, group_filename, fastq_filename, output_prefix, tree, )
def main( config_file: str = typer.Argument(...), field_to_use: fl_fields = typer.Option( fl_fields.count_fl, show_default=False, help="Which count field to use for chained sample", ), fuzzy_junction: int = typer.Option( 5, show_default=False, help="Max allowed distance in junction to be considered identical", ), version: bool = typer.Option( None, "--version", callback=version_callback, is_eager=True, help="Prints the version of the SQANTI3 package.", ), ) -> None: ( sample_dirs, sample_names, group_filename, gff_filename, count_filename, fastq_filename, ) = read_config(config_file) chain_fusion_samples( sample_dirs, sample_names, group_filename, gff_filename, count_filename, field_to_use, fuzzy_junction, fastq_filename, )
print(f1.name, file=sys.stderr) print(f2.name, file=sys.stderr) if fastq_filename is not None: print("all_samples.chained.rep.fq", file=sys.stderr) if __name__ == "__main__": from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument("config_file") parser.add_argument( "field_to_use", choices=['norm_fl', 'count_fl'], default='count_fl', help="Which count field to use for chained sample (default: count_fl)") parser.add_argument( "--fuzzy_junction", default=5, type=int, help= "Max allowed distance in junction to be considered identical (default: 5 bp)" ) #parser.add_argument("--allow_5merge", action="store_true", default=False, help="Allow 5' truncated transcripts (default: off)" ) args = parser.parse_args() sample_dirs, sample_names, group_filename, gff_filename, count_filename, fastq_filename = read_config( args.config_file) chain_fusion_samples(sample_dirs, sample_names, group_filename, gff_filename, count_filename, args.field_to_use, args.fuzzy_junction, fastq_filename)
f1.write('\n') f2.write('\n') f1.close() f2.close() shutil.copyfile('tmp_' + chain[-1] + '.gff', 'all_samples.chained.gff') if fastq_filename is not None: shutil.copyfile('tmp_' + chain[-1] + '.rep.fq', 'all_samples.chained.rep.fq') print >> sys.stderr, "Chained output written to:" print >> sys.stderr, "all_samples.chained.gff" print >> sys.stderr, f1.name print >> sys.stderr, f2.name if fastq_filename is not None: print >> sys.stderr, "all_samples.chained.rep.fq" if __name__ == "__main__": from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument("config_file") parser.add_argument("field_to_use", choices=['norm_fl', 'norm_nfl', 'norm_nfl_amb', 'count_fl', 'count_nfl', 'count_nfl_amb'], default='norm_nfl', help="Which count field to use for chained sample (default: norm_nfl)") parser.add_argument("--fuzzy_junction", default=5, type=int, help="Max allowed distance in junction to be considered identical (default: 5 bp)") #parser.add_argument("--allow_5merge", action="store_true", default=False, help="Allow 5' truncated transcripts (default: off)" ) args = parser.parse_args() sample_dirs, sample_names, group_filename, gff_filename, count_filename, fastq_filename = read_config(args.config_file) chain_fusion_samples(sample_dirs, sample_names, group_filename, gff_filename, count_filename, args.field_to_use, args.fuzzy_junction, fastq_filename)