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

Update - Patches for third party links used by Ariba #24010

Merged
merged 6 commits into from
Aug 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 8 additions & 3 deletions recipes/ariba/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ package:
source:
url: https://pypi.io/packages/source/a/ariba/ariba-{{ version }}.tar.gz
sha256: '{{ sha256 }}'

patches:
- pubmlst_getter.patch
- ref_genes_getter.patch

build:
number: 1
number: 2
skip: True # [py2k]
script: python -m pip install --no-deps --ignore-installed .

Expand All @@ -30,7 +33,7 @@ requirements:
- pyfastaq >=3.12.0
- pysam >=0.15.3 # older versions have wrong openssl pinning
- pymummer <=0.10.3
- bowtie2 >=2.3.1
- bowtie2 <2.4.0
- cd-hit >=4.6.5
- samtools >=1.2
- bcftools >=1.2
Expand All @@ -43,6 +46,8 @@ test:
imports:
- ariba
- ariba.tasks
commands:
- "ariba version"

about:
home: https://github.com/sanger-pathogens/ariba
Expand Down
23 changes: 23 additions & 0 deletions recipes/ariba/pubmlst_getter.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
From 6f0fb988cbc3d1f5386fd4ee67a73fae8005fb34 Mon Sep 17 00:00:00 2001
From: "Robert A. Petit III" <[email protected]>
Date: Mon, 17 Aug 2020 17:32:11 -0400
Subject: [PATCH] Fix for changes in PubMLST url

Related to https://github.com/sanger-pathogens/ariba/issues/304
---
ariba/pubmlst_getter.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ariba/pubmlst_getter.py b/ariba/pubmlst_getter.py
index 444f88e..b46b7d8 100644
--- a/ariba/pubmlst_getter.py
+++ b/ariba/pubmlst_getter.py
@@ -105,7 +105,7 @@ def _download_profile_and_fastas(self, outdir, profile_url, fasta_urls):
self._download_file(profile_url, profile_outfile)

for fasta_url in fasta_urls:
- outfile = os.path.join(outdir, fasta_url.split('/')[-1])
+ outfile = "{0}.tfa".format(os.path.join(outdir, fasta_url.split('/')[-2]))
self._download_file(fasta_url, outfile + '.tmp')
PubmlstGetter._rename_seqs_in_fasta(outfile + '.tmp', outfile)
os.unlink(outfile + '.tmp')
22 changes: 22 additions & 0 deletions recipes/ariba/ref_genes_getter.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From 8a68981d04eb22ad2ab0fbd0e3fc48d7e8012163 Mon Sep 17 00:00:00 2001
From: "Robert A. Petit III" <[email protected]>
Date: Wed, 12 Aug 2020 14:29:52 -0400
Subject: [PATCH] Solution 2 for fixing CARD downloads with getref

---
ariba/ref_genes_getter.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ariba/ref_genes_getter.py b/ariba/ref_genes_getter.py
index 0279d71..8c7b9f0 100644
--- a/ariba/ref_genes_getter.py
+++ b/ariba/ref_genes_getter.py
@@ -42,7 +42,7 @@ def __init__(self, ref_db, version=None, debug=False):
def _get_card_versions(self, tmp_file):
print('Getting available CARD versions')
common.download_file('https://card.mcmaster.ca/download', tmp_file, max_attempts=self.max_download_attempts, sleep_time=self.sleep_time, verbose=True)
- p = re.compile(r'''href="(/download/.*?broad.*?v([0-9]+\.[0-9]+\.[0-9]+)\.tar\.(gz|bz2))"''')
+ p = re.compile(r'''href="(/download/.*?broadstreet.*?v([0-9]+\.[0-9]+\.[0-9]+)\.tar\.(gz|bz2))"''')
versions = {}

with open(tmp_file) as f: