Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding Woltka v0.1.6, pairends #30

Merged
merged 29 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/qiita-plugin-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ jobs:
shell: bash -l {0}
run: |
conda config --add channels bioconda
conda create --yes -n qp-woltka-0.1.4 python=3.9 biom-format bowtie2
conda activate qp-woltka-0.1.4
conda create --yes -n qp-woltka python=3.9 biom-format bowtie2
conda activate qp-woltka
# bowtie2==2.5.0 is what's installed in main qiita so making sure we keep
# using the same version for consistency; note that we will need to force
conda install --yes -c bioconda bowtie2==2.5.0
Expand All @@ -87,7 +87,7 @@ jobs:
pip --quiet install -U pip pip nose flake8
pip --quiet install https://github.com/qiita-spots/qiita_client/archive/master.zip

export QIITA_SERVER_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
export QIITA_ROOTCA_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
export QIITA_CONFIG_FP=`pwd`/qiita-dev/qiita_core/support_files/config_test_local.cfg
export QC_WOLTKA_DB_DP=$PWD/qp_woltka/databases/woltka/
export QC_WOLTKA_SYNDNA_DB_DP=$PWD/qp_woltka/databases/synDNA
Expand All @@ -101,7 +101,7 @@ jobs:

export ENVIRONMENT="source /home/runner/.profile; conda activate qp-woltka; export QC_WOLTKA_DB_DP=$PWD/qp_woltka/databases/woltka/; export QC_WOLTKA_SYNDNA_DB_DP=$PWD/qp_woltka/databases/synDNA"

configure_woltka --env-script 'source /home/runner/.profile; conda activate qp-woltka-0.1.4; export QC_WOLTKA_DB_DP=$PWD/qp_woltka/databases/woltka/; export QC_WOLTKA_SYNDNA_DB_DP=$PWD/qp_woltka/databases/synDNA; export ENVIRONMENT="source /home/runner/.profile; conda activate qp-woltka-0.1.4; export QC_WOLTKA_DB_DP=$PWD/qp_woltka/databases/woltka/; export QC_WOLTKA_SYNDNA_DB_DP=$PWD/qp_woltka/databases/synDNA"' --server-cert $QIITA_SERVER_CERT
configure_woltka --env-script 'source /home/runner/.profile; conda activate qp-woltka; export QC_WOLTKA_DB_DP=$PWD/qp_woltka/databases/woltka/; export QC_WOLTKA_SYNDNA_DB_DP=$PWD/qp_woltka/databases/synDNA; export ENVIRONMENT="source /home/runner/.profile; conda activate qp-woltka; export QC_WOLTKA_DB_DP=$PWD/qp_woltka/databases/woltka/; export QC_WOLTKA_SYNDNA_DB_DP=$PWD/qp_woltka/databases/synDNA"' --ca-cert $QIITA_ROOTCA_CERT

echo "Available Qiita plugins"
ls ~/.qiita_plugins/
Expand All @@ -110,7 +110,7 @@ jobs:
shell: bash -l {0}
run: |
conda activate qiita
export QIITA_SERVER_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
export QIITA_ROOTCA_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
export QIITA_CONFIG_FP=`pwd`/qiita-dev/qiita_core/support_files/config_test_local.cfg
sed "s#/home/runner/work/qiita/qiita#${PWD}/qiita-dev/#g" `pwd`/qiita-dev/qiita_core/support_files/config_test.cfg > ${QIITA_CONFIG_FP}

Expand Down Expand Up @@ -141,10 +141,10 @@ jobs:
env:
COVER_PACKAGE: ${{ matrix.cover_package }}
run: |
conda activate qp-woltka-0.1.4
export QIITA_SERVER_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
conda activate qp-woltka
export QIITA_ROOTCA_CERT=`pwd`/qiita-dev/qiita_core/support_files/ci_rootca.crt
export QIITA_CONFIG_FP=`pwd`/qiita-dev/qiita_core/support_files/config_test_local.cfg
export ENVIRONMENT="source /home/runner/.profile; conda activate qp-woltka-0.1.4; export QC_WOLTKA_DB_DP=$PWD/qp_woltka/databases/woltka/; export QC_WOLTKA_SYNDNA_DB_DP=$PWD/qp_woltka/databases/synDNA"
export ENVIRONMENT="source /home/runner/.profile; conda activate qp-woltka; export QC_WOLTKA_DB_DP=$PWD/qp_woltka/databases/woltka/; export QC_WOLTKA_SYNDNA_DB_DP=$PWD/qp_woltka/databases/synDNA"
export QC_WOLTKA_DB_DP=$PWD/qp_woltka/databases/woltka/
export QC_WOLTKA_SYNDNA_DB_DP=$PWD/qp_woltka/databases/synDNA
export PYTHONWARNINGS="ignore:Certificate for localhost has no \`subjectAltName\`"
Expand Down
4 changes: 2 additions & 2 deletions qp_woltka/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
}
outputs = {
# taxonomic
'Alignment Profile': 'BIOM',
'Per genome Predictions': 'BIOM',
'Per gene Predictions': 'BIOM',
# functional
Expand All @@ -37,7 +36,8 @@
}
dflt_param_set = generate_woltka_dflt_params()
woltka_cmd = QiitaCommand(
'Woltka v0.1.4', "Functional and Taxonomic Predictions", woltka,
'Woltka v0.1.4, pairends + suppress singleton & discordant',
"Functional and Taxonomic Predictions", woltka,
req_params, opt_params, outputs, dflt_param_set)
plugin.register_command(woltka_cmd)

Expand Down
3 changes: 3 additions & 0 deletions qp_woltka/support_files/files_list.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
filename_1 filename_2 record_count
/tmp/folder/S22205_S104_L001_R1_001.fastq.gz /tmp/folder/S22205_S104_L001_R2_001.fastq.gz 1000000
/tmp/folder/S22282_S102_L001_R1_001.fastq.gz /tmp/folder/S22282_S102_L001_R2_001.fastq.gz 1000000
Binary file removed qp_woltka/support_files/free.biom
Binary file not shown.
36 changes: 36 additions & 0 deletions qp_woltka/support_files/summary.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th>filename</th>
<th>md5</th>
<th>file_type</th>
<th>reads</th>
</tr>
</thead>
<tbody>
<tr>
<td>S22205_S104_L001_R1_001.fastq.gz</td>
<td>9dcfb0c77674fdada176262963196db0</td>
<td>raw_forward_seqs</td>
<td>1000000</td>
</tr>
<tr>
<td>S22282_S102_L001_R1_001.fastq.gz</td>
<td>9dcfb0c77674fdada176262963196db0</td>
<td>raw_forward_seqs</td>
<td>1000000</td>
</tr>
<tr>
<td>S22205_S104_L001_R2_001.fastq.gz</td>
<td>9dcfb0c77674fdada176262963196db0</td>
<td>raw_reverse_seqs</td>
<td>1000000</td>
</tr>
<tr>
<td>S22282_S102_L001_R2_001.fastq.gz</td>
<td>9dcfb0c77674fdada176262963196db0</td>
<td>raw_reverse_seqs</td>
<td>1000000</td>
</tr>
</tbody>
</table>
41 changes: 1 addition & 40 deletions qp_woltka/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@
from unittest import main, TestCase
from os import environ
from os.path import join
from tempfile import TemporaryDirectory
import gzip
import io
import pandas as pd

from qp_woltka.util import (
get_dbs, generate_woltka_dflt_params, mux, demux, search_by_filename,
get_dbs, generate_woltka_dflt_params, search_by_filename,
merge_ranges, coverage_percentage)


Expand All @@ -38,41 +34,6 @@ def test_generate_woltka_dflt_params(self):

self.assertDictEqual(obs, exp)

def test_mux(self):
f1 = b"@foo\nATGC\n+\nIIII\n"
f2 = b"@bar\nAAAA\n+\nIIII\n"
exp = b"@foo@@@foofile\nATGC\n+\nIIII\n@bar@@@barfile\nAAAA\n+\nIIII\n"
with TemporaryDirectory() as d:
f1fp = join(d, 'foofile.fastq')
f2fp = join(d, 'barfile.fastq')
ofp = join(d, 'output')
with gzip.open(f1fp, 'wb') as fp:
fp.write(f1)
with gzip.open(f2fp, 'wb') as fp:
fp.write(f2)
with open(ofp, 'wb') as output:
mux([f1fp, f2fp], output)
with open(ofp, 'rb') as result:
obs = result.read()

self.assertEqual(obs, exp)

def test_demux(self):
prep = pd.DataFrame([['sample_foo', 'foofile'],
['sample_bar', 'barfile']],
columns=['sample_name', 'run_prefix'])
input_ = io.BytesIO(b"foo@@@foofile_R1\tATGC\t+\tIIII\nbar@@@"
b"barfile_R2\tAAAA\t+\tIIII\n")
expfoo = b"foo\tATGC\t+\tIIII\n"
expbar = b"bar\tAAAA\t+\tIIII\n"
with TemporaryDirectory() as d:
demux(input_, d.encode('ascii'), prep)
foo = open(join(d, 'sample_foo.sam'), 'rb').read()
bar = open(join(d, 'sample_bar.sam'), 'rb').read()

self.assertEqual(foo, expfoo)
self.assertEqual(bar, expbar)

def test_search_by_filename(self):
lookup = {'foo_bar': 'baz',
'foo': 'bar'}
Expand Down
Loading
Loading