diff --git a/tools/scripts/create_h5ad_optimus.py b/tools/scripts/create_h5ad_optimus.py index ec8bd12e..210f62a7 100755 --- a/tools/scripts/create_h5ad_optimus.py +++ b/tools/scripts/create_h5ad_optimus.py @@ -390,6 +390,11 @@ def create_h5ad_files(args): # Set variable names new_data.var_names = [x for x in new_data.var["Gene"]] + # Add GTF to uns field + + gtf_path = args.gtf_path + new_data.uns["reference_gtf_file"] = gtf_path + # Write h5ad file new_data.write(args.output_h5ad_path + ".h5ad") @@ -458,6 +463,14 @@ def main(): help="annotation file in GTF format", ) + parser.add_argument( + "--gtf_path", + dest="gtf_path", + default=None, + required=False, + help="annotation file path", + ) + parser.add_argument( "--output_path_for_h5ad", dest="output_h5ad_path", diff --git a/tools/scripts/create_snrna_optimus_exons_h5ad.py b/tools/scripts/create_snrna_optimus_exons_h5ad.py index 3250ee3a..d1876e61 100644 --- a/tools/scripts/create_snrna_optimus_exons_h5ad.py +++ b/tools/scripts/create_snrna_optimus_exons_h5ad.py @@ -352,6 +352,15 @@ def create_h5ad_files(args): # Set the layer = to the exon_counts csr matrix new_data.layers["exon_counts"]=exon_counts + # Original path from args.annotation_file + # Add GTF to uns field + + gtf_path = args.gtf_path + new_data.uns["reference_gtf_file"] = gtf_path + + # Write h5ad file + new_data.write(args.output_h5ad_path + ".h5ad") + # Write h5ad file new_data.write(args.output_h5ad_path + ".h5ad") @@ -426,6 +435,14 @@ def main(): help="annotation file in GTF format", ) + parser.add_argument( + "--gtf_path", + dest="gtf_path", + default=None, + required=False, + help="annotation file path", + ) + parser.add_argument( "--output_path_for_h5ad", dest="output_h5ad_path", diff --git a/tools/scripts/create_snrna_optimus_full_h5ad.py b/tools/scripts/create_snrna_optimus_full_h5ad.py index d587c1f8..e74e513f 100755 --- a/tools/scripts/create_snrna_optimus_full_h5ad.py +++ b/tools/scripts/create_snrna_optimus_full_h5ad.py @@ -335,6 +335,14 @@ def create_h5ad_files(args): # Set variable names new_data.var_names = [x for x in new_data.var["Gene"]] + # Add GTF to uns field + + gtf_path = args.gtf_path + new_data.uns["reference_gtf_file"] = gtf_path + + # Write h5ad file + new_data.write(args.output_h5ad_path + ".h5ad") + # Write h5ad file new_data.write(args.output_h5ad_path + ".h5ad") @@ -390,6 +398,14 @@ def main(): help="annotation file in GTF format", ) + parser.add_argument( + "--gtf_path", + dest="gtf_path", + default=None, + required=False, + help="annotation file path", + ) + parser.add_argument( "--output_path_for_h5ad", dest="output_h5ad_path",