Skip to content

Commit

Permalink
Add gffutils merge strategy to address #34
Browse files Browse the repository at this point in the history
  • Loading branch information
mdshw5 authored Oct 19, 2023
1 parent 9936079 commit abafc37
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pisces/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ def build_index(args, unknown_args):
disable_infer_genes=
not options["infer_features"],
disable_infer_transcripts=
not options["infer_features"])
not options["infer_features"],
merge_strategy='create_unique')
except:
tmp_db = os.path.join(download_dir, os.path.basename(gtf.path) + '.db')
logging.info(
Expand All @@ -208,7 +209,8 @@ def build_index(args, unknown_args):
disable_infer_genes=
not options["infer_features"],
disable_infer_transcripts=
not options["infer_features"])
not options["infer_features"],
merge_strategy='create_unique')
elif gtf.scheme.lower() in ('ftp', 'http', 'https'):
_gtf_local_path = os.path.join(download_dir,
os.path.basename(
Expand Down Expand Up @@ -241,7 +243,8 @@ def build_index(args, unknown_args):
disable_infer_genes=
not options["infer_features"],
disable_infer_transcripts=
not options["infer_features"])
not options["infer_features"],
merge_strategy='create_unique')
else:
logging.info(
"Creating GTF database file. This will take some time..."
Expand All @@ -253,7 +256,8 @@ def build_index(args, unknown_args):
disable_infer_genes=
not options["infer_features"],
disable_infer_transcripts=
not options["infer_features"])
not options["infer_features"],
merge_strategy='create_unique')
elif gtf.path.endswith('gz'):
logging.info("Loading existing GTF database file.")
db = gffutils.FeatureDB(
Expand All @@ -264,9 +268,6 @@ def build_index(args, unknown_args):

# https://github.com/daler/gffutils/issues/56
db.execute('ANALYZE features')
#if db.count_features_of_type('intron') == 0 and options["unprocessed_transcripts"]:
#logging.info("Inferring intronic sequences...")
#db.update(db.create_introns())
soft_chars = set(('a', 'c', 'g', 't'))

if not options["-k"]:
Expand Down Expand Up @@ -406,4 +407,4 @@ def features_to_string(features, fasta_in, masked=True, strand=True):
logging.info(line.rstrip())
else:
logging.info(line)
logging.info(line)
logging.info(line)

0 comments on commit abafc37

Please sign in to comment.