From 6b4d5dc41f9771eacae1fe6e9041d7e5ec660ee2 Mon Sep 17 00:00:00 2001 From: Drew Behrens Date: Tue, 26 Jan 2021 15:45:01 +0100 Subject: [PATCH] remove Bio.Alphabe, verison bump --- build/lib/mimseq/ssAlign.py | 11 +++++------ build/lib/mimseq/tRNAtools.py | 6 ++---- mimseq/version.py | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/build/lib/mimseq/ssAlign.py b/build/lib/mimseq/ssAlign.py index ad497ea..c11579e 100644 --- a/build/lib/mimseq/ssAlign.py +++ b/build/lib/mimseq/ssAlign.py @@ -4,7 +4,6 @@ import subprocess, os, re from Bio import AlignIO -from Bio.Alphabet import generic_rna from collections import defaultdict, Counter from itertools import groupby from operator import itemgetter @@ -23,7 +22,7 @@ def extraCCA(): # look for extra CCA's added spuriously that fall outside of canonical tRNA structure # Seems to be a problem in certain sequences in mouse - either an artifact from gtRNAdb or tRNAScan, or CCA is genomically encoded for these tRNAs? extra_cca = list() - stk = AlignIO.read(stkname, "stockholm", alphabet=generic_rna) + stk = AlignIO.read(stkname, "stockholm") for record in stk: if record.seq[-3:] == 'cca': #lowercase here indicates alignment issue to other clusters extra_cca.append(record.name) @@ -35,7 +34,7 @@ def extraCCA(): def tRNAclassifier(ungapped = False): struct_dict = structureParser() - stk = AlignIO.read(stkname, "stockholm", alphabet=generic_rna,) + stk = AlignIO.read(stkname, "stockholm") # Get canonical tRNA position numbering (cons_pos_list). Useful to retain cononical numbering of tRNA positions (i.e. anticodon at 34 - 36, m1A 58 etc...) # Return list of characters with pos or '-'. To be used in all plots with positional data such as heatmaps for stops or modifications. @@ -149,7 +148,7 @@ def tRNAclassifier_nogaps(): tRNA_struct = defaultdict(dict) # Loop thorugh every tRNA in alignment and create dictionary entry for pos - structure information (1-based to match to mismatchTable from mmQuant) - stk = AlignIO.read(stkname, "stockholm", alphabet=generic_rna) + stk = AlignIO.read(stkname, "stockholm") for record in stk: tRNA = record.id seq = record.seq @@ -191,7 +190,7 @@ def clusterAnticodon(cons_anticodon, cluster): # return anticodon position without gaps for specific cluster bases = ["A", "C", "G", "U"] - stk = AlignIO.read(stkname, "stockholm", alphabet=generic_rna) + stk = AlignIO.read(stkname, "stockholm") cluster_anticodon = list() for record in stk: if record.id == cluster: @@ -219,7 +218,7 @@ def modContext(out): upstream_dict = defaultdict(lambda: defaultdict(list)) - stk = AlignIO.read(stkname, "stockholm", alphabet=generic_rna) + stk = AlignIO.read(stkname, "stockholm") for record in stk: gene = record.id seq = record.seq diff --git a/build/lib/mimseq/tRNAtools.py b/build/lib/mimseq/tRNAtools.py index 6d025cf..3fd2004 100644 --- a/build/lib/mimseq/tRNAtools.py +++ b/build/lib/mimseq/tRNAtools.py @@ -8,12 +8,10 @@ from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord -from Bio import Alphabet from Bio.Blast.Applications import NcbiblastnCommandline from Bio.Blast import NCBIXML import re, copy, sys, os, shutil, subprocess, logging, glob from pathlib import Path -import urllib.request from collections import defaultdict import pandas as pd import requests @@ -317,7 +315,7 @@ def modsToSNPIndex(gtRNAdb, tRNAscan_out, mitotRNAs, modifications_table, experi nomatch_count += 1 # Build seqrecord list for writing - seq_records[str(seq)] = SeqRecord(Seq(tRNA_dict[seq]['sequence'].upper(), Alphabet.generic_dna), id = str(seq)) + seq_records[str(seq)] = SeqRecord(Seq(tRNA_dict[seq]['sequence'].upper()), id = str(seq)) tRNAbed.write(seq + "\t0\t" + str(len(tRNA_dict[seq]['sequence'])) + "\t" + seq + "\t1000\t+\n" ) @@ -443,7 +441,7 @@ def modsToSNPIndex(gtRNAdb, tRNAscan_out, mitotRNAs, modifications_table, experi centroids = SeqIO.parse(temp_dir + "all_centroids.fa", "fasta") for centroid in centroids: centroid.id = centroid.id.split(";")[0] - final_centroids[centroid.id] = SeqRecord(Seq(str(centroid.seq).upper(), Alphabet.generic_dna), id = centroid.id) + final_centroids[centroid.id] = SeqRecord(Seq(str(centroid.seq).upper()), id = centroid.id) # read cluster files, get nonredudant set of mod positions of all members of a cluster, create snp_records for writing SNP index cluster_pathlist = Path(temp_dir).glob("**/*_clusters.uc") diff --git a/mimseq/version.py b/mimseq/version.py index 6a35e85..260c070 100644 --- a/mimseq/version.py +++ b/mimseq/version.py @@ -1 +1 @@ -__version__ = "0.3" +__version__ = "0.3.1"