Skip to content
Open
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
27 changes: 27 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build & Test

on:
push:
schedule:
- cron: '0 3 * * 1'


jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Install ANARCI
run: |
python setup.py install
- name: Test with pytest
run: |
pip install pytest
pytest ./test
12 changes: 2 additions & 10 deletions bin/ANARCI
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,8 @@ if __name__ == "__main__":

# Check that hmmscan can be found in the path
if args.hmmerpath:
hmmerpath=args.hmmerpath
scan_path = os.path.join( hmmerpath, "hmmscan" )
if not ( os.path.exists( scan_path ) and os.access(scan_path, os.X_OK)):
print("Error: No hmmscan executable file found in directory: %s"%(hmmerpath), file=sys.stderr)
sys.exit(1)
elif not which("hmmscan"):
print("Error: hmmscan was not found in the path. Either install and add to path or provide path with commandline option.", file=sys.stderr)
sys.exit(1)


print('Note: ANARCI is using pyhmmer, ignoring --hmmerpath argument')

# Check if there should be some restriction as to which chain types should be numbered.
# If it is not the imgt scheme they want then restrict to only igs (otherwise you'll hit assertion errors)
types_to_chains = {"ig":["H","K","L"], "tr":["A", "B","G","D"], "heavy":["H"], "light":["K","L"] }
Expand Down
31 changes: 31 additions & 0 deletions build_pipeline/BuildHMM.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""
Build All.HMM from stockholm aligned file using PyHMMER
"""

import sys
import pyhmmer


def build(out_path, in_path):
alphabet = pyhmmer.easel.Alphabet.amino()
print('Loading MSA from {}'.format(in_path))
with pyhmmer.easel.MSAFile(in_path, digital=True, alphabet=alphabet) as msa_file:
msas = list(msa_file)

builder = pyhmmer.plan7.Builder(alphabet, architecture='hand')
background = pyhmmer.plan7.Background(alphabet)

print('Building HMMs from {} MSAs'.format(len(msas)))
hmms = []
with open(out_path, "wb") as output_file:
for msa in msas:
hmm, _, _ = builder.build_msa(msa, background)
hmm.write(output_file)
hmms.append(hmm)
print('Pressing HMMs')
pyhmmer.hmmpress(hmms, out_path)
print('Saved HMMs to {}'.format(out_path))


if __name__ == '__main__':
build(sys.argv[1], sys.argv[2])
8 changes: 1 addition & 7 deletions build_pipeline/RUN_pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,4 @@ python3 $DIR/FormatAlignments.py
# Build the hmms for each species and chain.
# --hand option required otherwise it will delete columns that are mainly gaps. We want 128 columns otherwise ARNACI will fall over.
mkdir -p $DIR/HMMs
hmmbuild --hand $DIR/HMMs/ALL.hmm $DIR/curated_alignments/ALL.stockholm
#hmmbuild --hand $DIR/HMMs/ALL_AND_C.hmm $DIR/curated_alignments/ALL_AND_C.stockholm

# Turn the output HMMs file into a binary form. This is required for hmmscan that is used in ARNACI.
hmmpress -f $DIR/HMMs/ALL.hmm
#hmmpress -f $DIR/HMMs/ALL_AND_C.hmm

python3 $DIR/BuildHMM.py $DIR/HMMs/ALL.hmm $DIR/curated_alignments/ALL.stockholm
Loading