Skip to content

Commit 888924c

Browse files
authored
Merge pull request #12 from luispedro/main
Minor touch ups and refactoring
2 parents 093be8e + d6d6f75 commit 888924c

File tree

11 files changed

+130
-198
lines changed

11 files changed

+130
-198
lines changed

.github/workflows/test_gmsc_mapper.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ jobs:
88
strategy:
99
matrix:
1010
os: [ubuntu-latest]
11-
python-version: ["3.8", "3.9"]
12-
13-
11+
python-version:
12+
- "3.8"
13+
- "3.9"
14+
- "3.10"
1415
steps:
1516
- uses: actions/checkout@v2
1617
- name: Set up Python ${{ matrix.python-version }}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
GMSC-mapper is a command line tool to query the Global Microbial smORFs Catalog (GMSC).
44

55
GMSC-mapper can be used to
6-
- Find query smORFs (< 100aa) homologous to Global Microbial smORFs Catalog (GMSC) by alignment.
6+
- Find query smORFs (&lt; 100aa) homologous to Global Microbial smORFs Catalog (GMSC) by alignment.
77
- Support 3 types of input:
88
- contigs (GMSC-mapper will predict smORFs from contigs first)
99
- amino acid sequences
@@ -21,7 +21,7 @@ Clone GMSC-mapper repository
2121
git clone https://github.com/BigDataBiology/GMSC-mapper.git
2222
```
2323

24-
Create conda environment(only support python v3.8/v3.9)
24+
Create conda environment(only support python v3.8-10)
2525

2626
```bash
2727
conda create -n gmscmapper python=3.8

gmsc_mapper/filter_length.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
1-
message_error = '''GMSC-mapper Error: Input sequences are all more than 303nt or 100aa,which will be filtered.
2-
Please check if your input consist of contigs, which should use -i not --nt-genes or --aa-genes as input.\n'''
1+
message_error = '''GMSC-mapper Error: Input sequences are all more than 303nt or 100aa,which will be filtered.
2+
Please check if your input consist of contigs, which should use -i not --nt-genes or --aa-genes as input.\n'''
33

44
def filter_length(queryfile, tmpdirname, N):
55
import sys
66
import gzip
77
from os import path
88
from .fasta import fasta_iter
9-
109
filtered_file = path.join(tmpdirname, "filtered.faa.gz")
1110

1211
with gzip.open(filtered_file, 'wt',compresslevel=1) as of:
13-
all_longer_flag = 1
14-
12+
all_longer_flag = True
1513
for ID, seq in fasta_iter(queryfile):
1614
if len(seq) < N:
17-
all_longer_flag = 0
15+
all_longer_flag = False
1816
of.write(f'>{ID}\n{seq}\n')
19-
17+
2018
if all_longer_flag:
2119
sys.stderr.write(message_error)
2220
sys.exit(1)
23-
2421
return filtered_file

0 commit comments

Comments
 (0)