-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from pdimens/dev
stage release of version 0.9
- Loading branch information
Showing
31 changed files
with
81,032 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Test Simulate Variants | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'dev' | ||
paths: | ||
- 'simulate**.smk' | ||
- 'workflow/envs/harpy.yaml' | ||
- '**helperfunctions.py' | ||
- '**printfunctions.py' | ||
- '**fileparsers.py' | ||
- 'test/vcf/test.bcf' | ||
- 'workflow/scripts/simuG.pl' | ||
- '**__main__.py' | ||
|
||
pull_request: | ||
branches: | ||
- 'dev' | ||
paths: | ||
- 'simulate**.smk' | ||
- 'workflow/envs/harpy.yaml' | ||
- '**helperfunctions.py' | ||
- '**printfunctions.py' | ||
- '**fileparsers.py' | ||
- 'test/vcf/test.bcf' | ||
- 'workflow/scripts/simuG.pl' | ||
- '**__main__.py' | ||
|
||
env: | ||
CACHE_NUMBER: 0 # increase to reset cache manually | ||
|
||
jobs: | ||
build: | ||
name: test simulations | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: setup mamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
env: | ||
ACTIONS_STEP_DEBUG: true | ||
with: | ||
init-shell: bash | ||
generate-run-shell: true | ||
environment-file: workflow/envs/harpy.yaml | ||
cache-environment: true | ||
post-cleanup: 'all' | ||
log-level: error | ||
- name: Install harpy | ||
shell: micromamba-shell {0} | ||
run: | | ||
python3 -m pip install --upgrade build && python3 -m build | ||
pip install dist/*.whl | ||
resources/buildforCI.sh | ||
- name: simulate random snps/indels | ||
shell: micromamba-shell {0} | ||
run: | | ||
harpy simulate snpindel --snp-count 10 --indel-count 10 -z 0.5 test/genome/genome.fasta.gz | ||
harpy simulate snpindel --prefix Simulate/snpvcf --snp-vcf Simulate/snpindel/sim.snpindel.snp.hap1.vcf --indel-vcf Simulate/snpindel/sim.snpindel.indel.hap1.vcf test/genome/genome.fasta.gz | ||
- name: simulate inversions | ||
shell: micromamba-shell {0} | ||
if: always() | ||
run: | | ||
harpy simulate inversion --count 10 -z 0.5 test/genome/genome.fasta.gz | ||
harpy simulate inversion --prefix Simulate/invvcf --vcf Simulate/inversion/sim.inversion.hap1.vcf test/genome/genome.fasta.gz | ||
- name: simulate cnv | ||
shell: micromamba-shell {0} | ||
if: always() | ||
run: | | ||
harpy simulate cnv --count 10 -z 0.5 test/genome/genome.fasta.gz | ||
harpy simulate cnv --prefix Simulate/cnvvcf --vcf Simulate/cnv/sim.cnv.hap1.vcf test/genome/genome.fasta.gz | ||
- name: simulate translocations | ||
shell: micromamba-shell {0} | ||
if: always() | ||
run: | | ||
harpy simulate translocation --count 10 -z 0.5 test/genome/genome.fasta.gz | ||
harpy simulate translocation --prefix Simulate/transvcf --vcf Simulate/translocation/sim.translocation.hap1.vcf test/genome/genome.fasta.gz | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ Genome/ | |
Align/ | ||
SNP/ | ||
SV/ | ||
Simulate/ | ||
Impute/ | ||
Preflight/ | ||
Phase/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#! /usr/bin/env python3 | ||
import argparse | ||
parser = argparse.ArgumentParser( | ||
prog='makewindows.py', | ||
description='Create a BED file of fixed intervals from a fasta.fai file (generated with samtools faidx). Nearly identical to bedtools makewindows, except the intervals are nonoverlapping.' | ||
) | ||
parser.add_argument("-i", dest = "infile", required = True, type=str, metavar = "<input.fasta.fai>", help="input fasta.fai file") | ||
parser.add_argument("-o", dest = "outfile", required = True, type=str, metavar = "<output.bed>", help="output BED file name") | ||
parser.add_argument("-w", dest = "window", type=int, metavar = "<window_size>", default = "10000", help="interval size (default: %(default)s)") | ||
args = parser.parse_args() | ||
|
||
with open(args.infile, "r") as fai: | ||
outbed = open(args.outfile, "w") | ||
while True: | ||
# Get next line from file | ||
line = fai.readline() | ||
# if line is empty | ||
# end of file is reached | ||
if not line: | ||
break | ||
# split the line by tabs | ||
lsplit = line.split("\t") | ||
contig = lsplit[0] | ||
c_len = int(lsplit[1]) | ||
start = 1 | ||
end = args.window | ||
starts = [1] | ||
ends = [args.window] | ||
while end < c_len: | ||
end = end + args.window if (end + args.window) < c_len else c_len | ||
ends.append(end) | ||
start += args.window | ||
starts.append(start) | ||
|
||
# write to output file | ||
for (startpos, endpos) in zip (starts,ends): | ||
outbed.write(f"{contig}\t{startpos}\t{endpos}\n") | ||
outbed.close() |
Oops, something went wrong.