Skip to content

Commit

Permalink
Fix utilities and minor miscellaneous issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ljyanesm committed May 25, 2021
1 parent ab4d0c1 commit 8dfc099
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
4 changes: 0 additions & 4 deletions Mikado/configuration/scoring_files/HISTORIC/insects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ scoring:
filter: {operator: lt, value: 3}
rescaling: target
value: 1
three_utr_num:
filter: {operator: lt, value: 3}
rescaling: target
value: 1
five_utr_num:
filter: {operator: lt, value: 4}
rescaling: target
Expand Down
1 change: 0 additions & 1 deletion Mikado/subprograms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

"""This module contains the subprograms launched by the Mikado suite"""

# from ..parsers import GTF, GFF, to_gff
# noinspection PyPep8
from . import configure
# noinspection PyPep8
Expand Down
6 changes: 4 additions & 2 deletions util/calculate_distances.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from scipy.stats.mstats import mquantiles
from numpy import arange

from Mikado.scales.reference_preparation.indexing import load_index
from Mikado.utilities import log_utils
from Mikado.utilities.log_utils import LoggingConfiguration


Expand Down Expand Up @@ -109,7 +111,7 @@ def main():
args = parser.parse_args()

conf = LoggingConfiguration(log=args.log, log_level=args.log_level)
logger = Mikado.utilities.log_utils.create_logger_from_conf(conf, "geomancer", mode="w")
logger = log_utils.create_logger_from_conf(conf, "geomancer", mode="w")
logger.info("Starting to load the GFF3 index")
with open(args.gff3) as gff3:
namespace = argparse.Namespace
Expand All @@ -119,7 +121,7 @@ def main():
# Use Mikado compare functions to load the index from the GFF3
# "genes" is a dictionary of Gene objects, having as keys the gene names
# "positions" is a dictionary of the form: [chrom][(start, end)] = [GID1, GID2, ...]
genes, positions = Mikado.scales.compare.load_index(args, logger)
genes, positions = load_index(args, logger)
# Create a dictionary of interval trees, one per chromosome
indexer = collections.defaultdict(list).fromkeys(positions)
for chrom in indexer:
Expand Down
1 change: 0 additions & 1 deletion util/create_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import argparse
import csv
import pickle
from sklearn.ensemble import RandomForestRegressor
import numpy as np
from scipy.stats import hmean
from Mikado.scales.resultstorer import ResultStorer
Expand Down
9 changes: 5 additions & 4 deletions util/trim_long_introns.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
from Mikado.loci import Transcript, Gene
import argparse
import sys

from Mikado.parsers import parser_factory
from Mikado.parsers.GFF import GFF3
from Mikado.utilities import to_gff
from intervaltree import Interval
from Mikado.utilities.log_utils import create_default_logger

__doc__ = """This script truncates transcript with UTR exons separated by long introns."""

from Mikado.utilities import Interval


def remove_introns_from_transcr(transcript, args):
transcript.finalize()
Expand Down Expand Up @@ -78,7 +79,7 @@ def main():
parser = argparse.ArgumentParser(__doc__)
parser.add_argument("-mi", "--max-intron", default=10000, dest="max_intron",
type=int, help="Maximum intron length for UTR introns.")
parser.add_argument("gff", type=to_gff)
parser.add_argument("gff", type=parser_factory)
parser.add_argument("out", default=sys.stdout, type=argparse.FileType("wt"), nargs="?")
args = parser.parse_args()

Expand Down

0 comments on commit 8dfc099

Please sign in to comment.