Compare commits

...

5 Commits

Author SHA1 Message Date
587c2e753a '.gitignore' now ignores 'output' directory
Some checks failed
ydeng/bmlsa/pipeline/head There was a failure building this commit
2023-04-28 11:33:22 -05:00
00cedbb181 Created convenience VSCode 'launch.json' 2023-04-28 11:32:35 -05:00
11d5590355 Added another post-installation test step 2023-04-28 11:32:17 -05:00
c34b219306 CLI will now recursively make output directory if needed 2023-04-28 11:31:41 -05:00
6017eadb2c Clean sequences of line breaks and carriage return 2023-04-28 11:30:23 -05:00
5 changed files with 32 additions and 3 deletions

1
.gitignore vendored
View File

@ -212,3 +212,4 @@ pyrightconfig.json
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
output

26
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "bmlsa.cli",
"args": [
"-I",
"id",
"-S",
"sequence",
"-B",
"BLASTp",
"${workspaceFolder}/tests/resources/SARS_CoV-2_genes.csv",
"${workspaceFolder}/tests/resources/NC_045512_coding.fasta",
"${workspaceFolder}/output"
],
"justMyCode": true
}
]
}

1
Jenkinsfile vendored
View File

@ -27,6 +27,7 @@ pipeline {
steps {
sh "pip install dist/*.whl --force-reinstall"
sh "bmlsa -h"
sh "bmlsa -I id -S sequence -B BLASTp tests/resources/SARS_CoV-2_genes.csv tests/resources/NC_045512_coding.fasta /output/"
}
}
stage("archive") {

View File

@ -28,7 +28,7 @@ def run(args):
'"--alignment-mode", or, at least "--behave-as". See help (-h) for '
"more information."
)
exit(1)
exit(3)
queries = read_annotations_from_csv(
args.annotations,
args.id_header,
@ -41,7 +41,7 @@ def run(args):
if args.behave_as and args.behave_as not in DEFAULT_ALIGNMENT_PARAMETERS:
logger.error('"--behave-as" received bad option.')
exit(1)
exit(3)
scoring_parameter = (
{
@ -56,6 +56,7 @@ def run(args):
else DEFAULT_ALIGNMENT_PARAMETERS[args.behave_as]
)
os.makedirs(args.output, exist_ok=True)
with open(args.sequence, "r") as sequence_fd:
for sequence in SeqIO.parse(sequence_fd, "fasta"):
aligned_annotations = align_many_to_one_ssw(

View File

@ -14,7 +14,7 @@ class AlignedSequence:
self._end = end
self._id = id
self._name = name
self._sequence = sequence
self._sequence = sequence.replace("\n", "").replace("\r", "")
self._score = score
@property