Skip to content

Commit

Permalink
Merge branch '1.6.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
agshumate committed Apr 8, 2021
2 parents e118ae7 + 722c145 commit 8d1a624
Show file tree
Hide file tree
Showing 10 changed files with 263 additions and 12 deletions.
11 changes: 11 additions & 0 deletions .idea/Liftoff.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

205 changes: 205 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions liftoff/extract_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
import numpy as np
import ujson as json

import gzip



Expand Down Expand Up @@ -40,8 +40,6 @@ def build_database(db, gff_file, disable_transcripts, disable_genes,):
feature_db = gffutils.create_db(gff_file, gff_file + "_db", merge_strategy="create_unique", force=True,
disable_infer_transcripts=disable_transcripts,
disable_infer_genes=disable_genes, verbose=True)


except:
find_problem_line(gff_file)
else:
Expand All @@ -52,6 +50,7 @@ def build_database(db, gff_file, disable_transcripts, disable_genes,):




def find_problem_line(gff_file):
f = open(gff_file, 'r')
lines = f.readlines()
Expand Down Expand Up @@ -186,14 +185,14 @@ def write_gene_sequences_to_file(chrom_name, reference_fasta_name, reference_fas
current_chrom = parents[0].seqid
else:
current_chrom = chrom_name
chrom_seq = reference_fasta_idx[current_chrom]
chrom_seq = reference_fasta_idx[current_chrom][:].seq
for parent in parents:
if parent.seqid != current_chrom and chrom_name == reference_fasta_name:
current_chrom = parent.seqid
chrom_seq = reference_fasta_idx[current_chrom]
chrom_seq = reference_fasta_idx[current_chrom][:].seq
if parent.seqid == chrom_name or chrom_name == reference_fasta_name:
gene_length = parent.end - parent.start + 1
parent.start = round(max(1, parent.start - args.flank * gene_length))
parent.end = round(min(parent.end + args.flank * gene_length, len(chrom_seq)))
parent_seq = chrom_seq[parent.start - 1: parent.end].seq
parent_seq = chrom_seq[parent.start - 1: parent.end]
fasta_out.write(">" + parent.id + "\n" + str(parent_seq) + "\n")
2 changes: 1 addition & 1 deletion liftoff/run_liftoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def parse_args(arglist):
"target and "
"reference; by default F=0.0")

parser.add_argument('-V', '--version', help='show program version', action='version', version='v1.6.0')
parser.add_argument('-V', '--version', help='show program version', action='version', version='v1.6.1')
parser.add_argument(
'-p', default=1, type=int, metavar='P', help='use p parallel processes to accelerate alignment; by default p=1'
)
Expand Down
8 changes: 4 additions & 4 deletions liftoff/write_new_gff.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ def edit_copy_ids(feature):
copy_num = feature.attributes["extra_copy_number"][0]
if copy_num != '0':
feature.attributes["ID"] = [feature.attributes["ID"][0]+ "_" + copy_num]
if "Parent" in feature.attributes:
feature.attributes["Parent"] = [feature.attributes["Parent"][0] + "_" + copy_num]
if "gene_id" in feature.attributes:
feature.attributes["gene_id"] = [feature.attributes["gene_id"][0] + "_" + copy_num]
if "Parent" in feature.attributes:
feature.attributes["Parent"] = [feature.attributes["Parent"][0] + "_" + copy_num]
if "gene_id" in feature.attributes:
feature.attributes["gene_id"] = [feature.attributes["gene_id"][0] + "_" + copy_num]


def make_gtf_line(feature):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setuptools.setup(
name="Liftoff",
version="1.6.0",
version="1.6.1",
author="Alaina Shumate",
author_email="ashumat2@jhmi.edu",
description="A gene annotation mapping tool",
Expand Down

0 comments on commit 8d1a624

Please sign in to comment.