Skip to content

Commit

Permalink
Skip sequences shorter than 4 nucleotides
Browse files Browse the repository at this point in the history
  • Loading branch information
apcamargo committed Jan 23, 2020
1 parent a6460a1 commit c2c0bdb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rnasamba"
version = "0.2.3"
version = "0.2.4"
authors = ["Antonio Camargo <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN pip install --no-cache-dir \
'biopython==1.74' \
'keras==2.2.5' \
'numpy==1.16.5' \
'rnasamba==0.2.3' \
'rnasamba==0.2.4' \
'tensorflow==1.14.0'

VOLUME ["/app"]
Expand Down
6 changes: 3 additions & 3 deletions rnasamba/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def train(args):


def classify_cli(parser):
parser.add_argument('--version', action='version', version='%(prog)s 0.2.3')
parser.add_argument('--version', action='version', version='%(prog)s 0.2.4')
parser.set_defaults(func=classify)
parser.add_argument(
'output_file',
Expand Down Expand Up @@ -79,7 +79,7 @@ def classify_cli(parser):

def train_cli(parser):
parser.set_defaults(func=train)
parser.add_argument('--version', action='version', version='%(prog)s 0.2.3')
parser.add_argument('--version', action='version', version='%(prog)s 0.2.4')
parser.add_argument(
'output_file',
help='output HDF5 file containing weights of the newly trained RNAsamba network.',
Expand Down Expand Up @@ -128,7 +128,7 @@ def cli():
description='Coding potential calculation using deep learning.',
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument('--version', action='version', version='%(prog)s 0.2.3')
parser.add_argument('--version', action='version', version='%(prog)s 0.2.4')
subparsers = parser.add_subparsers()
classify_parser = subparsers.add_parser(
'classify',
Expand Down
11 changes: 7 additions & 4 deletions rnasamba/core/sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ def read_fasta(filename):
with open(filename) as handle:
for record in SeqIO.parse(handle, 'fasta'):
sequence_str = str(record.seq).upper().replace('U', 'T')
sequence_name = record.description
seqs.append(sequence_str)
seqs_tokenized.append(tokenize_dna(sequence_str))
seqs_names.append(sequence_name)
if len(sequence_str) < 4:
continue
else:
sequence_name = record.description
seqs.append(sequence_str)
seqs_tokenized.append(tokenize_dna(sequence_str))
seqs_names.append(sequence_name)
return seqs, seqs_tokenized, seqs_names


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

setup(
name='rnasamba',
version='0.2.3',
version='0.2.4',
packages=find_packages(),
rust_extensions=[
RustExtension('rnasamba.core.kmer', debug=False),
Expand Down

0 comments on commit c2c0bdb

Please sign in to comment.