Skip to content
Open
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
ea53bd3
star plot: green (NCTN) and yellow (DH>1) line instead of common red …
GWarsow Nov 14, 2018
3836328
added PID to covBaf plot filename
GWarsow Nov 28, 2018
bba909d
removed inappropriate cvalues from config xml file
GWarsow Nov 28, 2018
e0d4a50
integrated overseen code (dh_Stop method 'quanile', exit due to 'high…
GWarsow Nov 28, 2018
9586a6a
Merge branch 'master' into develop
GWarsow Nov 28, 2018
3109026
corrected indentation
GWarsow Nov 28, 2018
5e86bfa
added contributing segments file for LST
GWarsow Dec 12, 2018
3b3d7fb
implemented gene annotation in TCN chromosome plots [turned off by de…
GWarsow Jan 4, 2019
68f24bc
added missing parameter (secondChoicePloidyFilnameAddition)
GWarsow Jan 17, 2019
4ba122f
added debugging lines
GWarsow Jan 17, 2019
1dd2cf7
use Mclust with verbose=TRUE when cvalue runInDebugMode is set to "true"
GWarsow Feb 22, 2019
530ba17
quoted email parameter value
Apr 23, 2019
78e1612
Changed the phasing routine by exchanging impute2 with Beagle
Dec 4, 2019
1888521
renamed phasing scripts
Dec 4, 2019
368a3c5
Cleaned phasing procedure. Deleted all files and paths related to imp…
tlkaufmann Dec 4, 2019
1a8069a
Fixed typo
tlkaufmann Dec 4, 2019
de2b5a0
Finished off cleaning of phasing procedure. Renaming of files and too…
tlkaufmann Dec 4, 2019
a96db03
updated parameter.rst table with beagle parameters
tlkaufmann Dec 4, 2019
eff8785
changed download file to include Bealge references
tlkaufmann Dec 5, 2019
e49047a
Additional changes to the phasing routine: adapted the downloadRefere…
tlkaufmann Dec 5, 2019
9600f4b
Adapted configuration file to match the location of the Beagle refere…
tlkaufmann Dec 10, 2019
27451e6
Compiled plugin and changed version number to 6.0.0
tlkaufmann Dec 13, 2019
c8a953f
Fix crash: Included the parameter 'sharedFilesBaseDirectory' in the c…
tlkaufmann Dec 13, 2019
0a6de5a
Changed the location of the Beagle reference files in the configuration
tlkaufmann Dec 13, 2019
fd79e51
Merge branch 'renamed'
tlkaufmann Dec 16, 2019
c9aa6a0
Minor change in phasing.sh to ensure correct handling by Roddy when j…
tlkaufmann Dec 16, 2019
2160ea7
changed documentation
tlkaufmann Dec 16, 2019
f880d0a
Changes to phasing_x.sh for better roddy compatibility
tlkaufmann Dec 16, 2019
f11ed17
Changed tabs to spaces
tlkaufmann Dec 18, 2019
9a41797
better way of checking if line is comment
tlkaufmann Dec 18, 2019
1061eeb
better handling of errors in phasing.sh and phasing_X.sh
tlkaufmann Dec 18, 2019
13bdfe2
cleaned config file of hardcoded paths
tlkaufmann Dec 18, 2019
cfec6c9
Made Beagle helper scripts more readable and included assertion state…
tlkaufmann Dec 18, 2019
944304d
removed references to local file structure from config file
tlkaufmann Dec 19, 2019
72f796b
Improved error handling in phasing.sh and phasing_x.sh with helper fu…
tlkaufmann Dec 19, 2019
232cbd0
improved bash variables in phasing.sh and phasing_X.sh
tlkaufmann Dec 19, 2019
94b4eb4
Changes in the phasing routine to fix crashes of the workflow. Includ…
tlkaufmann Dec 23, 2019
081e236
Merge pull request #16 from tomkau93/master
Dec 29, 2019
524037d
Changed config file to accomodate hg38 reference data. Also changed a…
tlkaufmann Dec 29, 2019
14954cd
Merge pull request #17 from tomkau93/hg38
Dec 29, 2019
a2e30c1
homodel artifact liftover
NagaComBio Feb 15, 2021
df9e662
change in env path
NagaComBio Feb 15, 2021
778079b
removing quotes around OPTs
NagaComBio Feb 15, 2021
118f4c6
change in chr length file
NagaComBio Feb 15, 2021
87f6439
config update
NagaComBio Feb 15, 2021
209a232
updating job mem request
NagaComBio Feb 15, 2021
5e7fdbc
CRAM support with samtools/bcftools update
NagaComBio Feb 23, 2021
e8a7fc7
potential homodel artifacts
NagaComBio Apr 30, 2021
5004ae1
Variant calling from bcftools
NagaComBio Apr 30, 2021
a8b2f55
fixing typo
NagaComBio Apr 30, 2021
19b3100
Increasing beagle's memory & core allocation
NagaComBio Apr 30, 2021
5c4ad09
Adapting XML for hg19 config
NagaComBio Apr 30, 2021
3d16416
New hg38 config XML
NagaComBio Apr 30, 2021
346e68a
parameterizing Beagle resources
NagaComBio May 19, 2021
b139c9a
Merge pull request #18 from NagaComBio/hg38
NagaComBio May 26, 2021
9b86c36
README & scripts to prepare hg38 reference files
NagaComBio Jun 14, 2021
52c6c5a
Based on code-review suggestions
NagaComBio Jun 14, 2021
7b0d1ff
Merge branch 'hg38' of https://github.com/DKFZ-ODCF/ACEseqWorkflow in…
NagaComBio Jun 14, 2021
f52f086
fixing typo in GRCh38_related_files/README
NagaComBio Jun 14, 2021
e6a5845
Add '--comment' to tabix scripts
NagaComBio Jun 28, 2022
30555e1
Update LSF memory requirements
NagaComBio Jun 28, 2022
09bd58f
Merge branch 'master' into hg38
NagaComBio Jul 1, 2022
fe1b82b
Add temp hg38 centromer file
NagaComBio Aug 3, 2022
d5706f9
Upgrade COWorkflowsBasePlugin to 1.3.0
NagaComBio Aug 3, 2022
232a81d
Merge branch 'develop' into hg38
NagaComBio Aug 3, 2022
e3fc99f
update the hg38 centromer file
NagaComBio Oct 6, 2022
1229a24
Remove the NULL line in the pruned file
NagaComBio Oct 6, 2022
eb26938
Add druggable gene list
NagaComBio Oct 6, 2022
e783d7e
Update GRCh38 installation files
NagaComBio Oct 6, 2022
6549fe0
Update hg38 mappability files to M2E2 with ALT & HLA contigs
NagaComBio Oct 6, 2022
779d5b0
update homodel artifact list
NagaComBio Oct 6, 2022
fc26eb6
update the shebang lines
NagaComBio Oct 6, 2022
8655540
Update README
NagaComBio Oct 6, 2022
8a29539
Remove beagle jar & update beagle to 5.2
NagaComBio Oct 31, 2022
8ffd230
Update COWorkflowsBasePlugin to 1.4.2
NagaComBio Oct 31, 2022
2d0ec65
Update ref file location
NagaComBio Mar 23, 2023
8eda5e9
Fix tmpHaploblocks unbound variable issue
NagaComBio Mar 23, 2023
ab85dc9
Fix for NoControl workflow
NagaComBio Nov 10, 2023
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ build/
*.swp
*.DS_Store
#.+
hg19_GRCh37_1000genomes
Binary file modified ACEseqWorkflow.jar
100755 → 100644
Binary file not shown.
File renamed without changes.
4 changes: 4 additions & 0 deletions README.ACEseqWorkflow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ isNoControlWorkflow false Run analysis with matching control and estim

== Changelist

* Version update 6.0.0
- Changed the phasing routine. The program "impute2" was replaced by "Beagle". Files and tools were renamed accordingly.
- Generally renamed all tools and files from "imputeGenotype" to "phaseGenotype" (and so on) as the subroutine does not actually perform imputation but rather phasing.

* Version update to 5.0.1
- fixed density(NA) bug and index bug for frequencies (as.character) in clustering step

Expand Down
2 changes: 1 addition & 1 deletion buildversion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5.0
6.0
0
2 changes: 1 addition & 1 deletion documentation/source/methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Methods - Theory
================


| ACEseq can be used to estimate copy-numbers from WGS data using a tumor vs. control approach. Thus a pre-requesite is WGS data from healthy tissue and tumor tissue of the same patient with at least 30x coverage. Samtools [] mpileup is used to determine the coverage for tumor and control sample - position specific for each single nucleotide polymorphism (SNP) position recorded in dbSNP and per 1 kb window. To get chromosome specific allele frequencies, the genotypes of SNP positions are phased with Impute2 [] and A and B allele are assigned accordingly. Haploblocks are defined as regions with consecutively phased SNPs. Subsequently, B-allele frequencies (BAFs) are estimated for all SNP positions in tumor and control with sufficient coverage in the control:
| ACEseq can be used to estimate copy-numbers from WGS data using a tumor vs. control approach. Thus a pre-requesite is WGS data from healthy tissue and tumor tissue of the same patient with at least 30x coverage. Samtools [] mpileup is used to determine the coverage for tumor and control sample - position specific for each single nucleotide polymorphism (SNP) position recorded in dbSNP and per 1 kb window. To get chromosome specific allele frequencies, the genotypes of SNP positions are phased with Beagle [] and A and B allele are assigned accordingly. Haploblocks are defined as regions with consecutively phased SNPs. Subsequently, B-allele frequencies (BAFs) are estimated for all SNP positions in tumor and control with sufficient coverage in the control:
Comment thread
NagaComBio marked this conversation as resolved.
Outdated

.. math::
\label{eq:BAF}
Expand Down
30 changes: 9 additions & 21 deletions documentation/source/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Multiple parameters can be set with ACEseq though not all are necessary to chang
svOutputDirectory,${outputAnalysisBaseDirectory}/SV_calls,path,
crestOutputDirectory,${outputAnalysisBaseDirectory}/crest,path,
cnvSnpOutputDirectory,${aceseqOutputDirectory}/cnv_snp,path,
imputeOutputDirectory,${aceseqOutputDirectory}/phasing,path,
phasingOutputDirectory,${aceseqOutputDirectory}/phasing,path,
plotOutputDirectory,${aceseqOutputDirectory}/plots,path,
runWithoutControl,false,boolean,use control for analysis (false|true)
minHT,5,integer,minimum number of consecutive SNPs to be considered for haploblocks
Expand Down Expand Up @@ -41,7 +41,7 @@ Multiple parameters can be set with ACEseq though not all are necessary to chang
min_distance,0.05,float,min_distance
haplogroupFilePrefix,haploblocks_chr,string,prefix for file with haplogroups per chromosome
haplogroupFileSuffix,txt,string,suffix for file with haplogroups per chromosome
haplogroupFilePath,${imputeOutputDirectory}/${haplogroupFilePrefix},path,
haplogroupFilePath,${phasingOutputDirectory}/${haplogroupFilePrefix},path,
min_length_purity,1000000,integer,minimum length of segments to be considered for tumor cell content and ploidy estimation
min_hetSNPs_purity,500,integer,minimum number of control heterozygous SNPs in segments to be considered for tumor cell content and ploidy estimation
dh_stop,max,string,
Expand Down Expand Up @@ -72,18 +72,9 @@ Multiple parameters can be set with ACEseq though not all are necessary to chang
PATIENTSEX,male,string,patient sex used in case of no control workflow (male|female|klinefelter)
CNV_ANNO_SUFFIX,cnv.anno.tab.gz,string,suffix for mappability annotated chromosome-wise 1kb coverage files
CNV_SUFFIX,cnv.tab.gz,string,suffix chromosome-wise 1kb coverage files
FILE_UNPHASED_PRE,${imputeOutputDirectory}/${unphasedGenotypesFilePrefix},path,
FILE_UNPHASED_GENOTYPE,${imputeOutputDirectory}/unphased_genotype_chr,path,
FILE_PHASED_PRE,${imputeOutputDirectory}/${phasedGenotypesFilePrefix},path,
FILE_PHASED_GENOTYPE,${imputeOutputDirectory}/phased_genotype_chr,path,
FILE_INFO,info,string,
FILE_INFO_SAMPLE,info_by_sample,string,
FILE_HAPS,haps,string,
FILE_HAPS_CONF,haps_confidence,string,
FILE_SUMMARY,summary,string,
FILE_WARNINGS,warnings,string,
FILE_PART,part,string,
FILE_SAMPLE_G,${imputeOutputDirectory}/sample_g.txt,path,sample_g file used by imputation on X chromosome for females
FILE_UNPHASED_PRE,${phasingOutputDirectory}/${unphasedGenotypesFilePrefix},path,
FILE_PHASED_GENOTYPE,${phasingOutputDirectory}/phased_genotype_chr,path,
FILE_SAMPLE_G,${phasingOutputDirectory}/sample_g.txt,path,sample_g file used by imputation on X chromosome for females
Comment thread
vinjana marked this conversation as resolved.
MALE_FAKE_CONTROL_PRE,${pathToACEseqResults}/cnv_snp/${pid}.chr,path,path and prefix to chromosome-wise 1kb coverage file used for fake control workflow for male patients
FEMALE_FAKE_CONTROL_PRE,${pathToACEseqResults}/cnv_snp/${pid}.chr,path,path and prefix to chromosome-wise 1kb coverage file used for fake control workflow for female patients
PLOT_PRE,${aceseqOutputDirectory}/${pid}_plot,path,
Expand All @@ -104,16 +95,13 @@ Multiple parameters can be set with ACEseq though not all are necessary to chang
CHROMOSOME_LENGTH_FILE,${path}/chrlengths.txt,path,
REPLICATION_TIME_FILE,${path}/ReplicationTime_10cellines_mean_10KB.Rda,path,"replication timing file"
GC_CONTENT_FILE,${path}/hg19_GRch37_100genomes_gc_content_10kb.txt,path,
GENETIC_MAP_FILE,${path}/genetic_map_chr${CHR_NAME}_combined_b37.txt,path,"impute files"
KNOWN_HAPLOTYPES_FILE,${path}/ALL.chr${CHR_NAME}.integrated_phase1_v3. 20101123.snps_indels_svs.genotypes.nomono.haplotypes.gz,path,"impute files"
KNOWN_HAPLOTYPES_LEGEND_FILE,${path}ALL.chr${CHR_NAME}.integrated_phase1_v3. 20101123.snps_indels_svs.genotypes.nomono.legend.gz,path,"impute files"
GENETIC_MAP_FILE_X,${path}/genetic_map_chrX_nonPAR_combined_b37.txt,path,"impute files"
KNOWN_HAPLOTYPES_FILE_X,${path}/ALL_1000G_phase1integrated_v3_chrX_nonPAR_impute.hap.gz,path,"impute files"
KNOWN_HAPLOTYPES_LEGEND_FILE_X,${path}/ALL_1000G_phase1integrated_v3_chrX_nonPAR_impute.legend.gz,path,"impute files"
outputExecutionDirectory,${path}/exec_${executionTimeString},,"path to log files"
imputeBaseDirectory,${path}/,path,"directory for impute files"
mergedBamSuffix,merged.mdup.bam,string,"A list of all known suffixes for merged bam files. I.e. merged.dupmark.bam, merged.mdup.bam..."
mergedBamSuffixList,${mergedBamSuffix},string,"A list of all known suffixes for merged bam files. I.e. merged.dupmark.bam, merged.mdup.bam..."
defaultMergedBamSuffix,${mergedBamSuffix},string,The default suffix for merged bam files when they are created by Roddy.
libloc_PSCBS,,string,path to PSCBS library in R
libloc_flexclust,,string,path to felxclust library in R
BEAGLE_REFERENCE_FILE,${baseDirectoryReference}/tools_data/Beagle/chr${CHR_NAME}.1kg.phase3.v5a.b37.bref3,path
BEAGLE_REFERENCE_FILE_X,${baseDirectoryReference}/tools_data/Beagle/chrX.1kg.phase3.v5a.b37.bref3,path
BEAGLE_GENETIC_MAP,${baseDirectoryReference}/tools_data/genetic_maps/plink.chr${CHR_NAME}.GRCh37.map,path
BEAGLE_GENETIC_MAP_X,${baseDirectoryReference}/tools_data/genetic_maps/plink.chrX.GRCh37.map,path
150 changes: 80 additions & 70 deletions installation/downloadReferences.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ trap 'echo "Download incomplete. Please restart script."' ERR

# convenience function to create a directory and change into it
mkdir_cd() {
mkdir -p "$1"
cd "$1"
mkdir -p "$1"
cd "$1"
}

# compute an MD5 sum over all files found recursively in the current directory
# and check it against the MD5 sum given in the variable EXPECTED_MD5SUM
check_md5sum() {
local FILES=$(find -type f | sort)
local MD5SUM=$([ -n "$FILES" ] && cat $FILES | md5sum | cut -f1 -d' ')
[ "$EXPECTED_MD5SUM" = "$MD5SUM" ]
local FILES=$(find -type f | sort)
local MD5SUM=$([ -n "$FILES" ] && cat $FILES | md5sum | cut -f1 -d' ')
[ "$EXPECTED_MD5SUM" = "$MD5SUM" ]
}


Expand All @@ -31,118 +31,128 @@ mkdir_cd hg19_GRCh37_1000genomes
# download reference genome
###############################################################################
(
mkdir_cd sequence/1KGRef
mkdir_cd sequence/1KGRef

EXPECTED_MD5SUM=12a0bed94078e2d9e8c00da793bbc84e
check_md5sum && exit 0 || echo downloading reference genome....
EXPECTED_MD5SUM=12a0bed94078e2d9e8c00da793bbc84e
check_md5sum && exit 0 || echo downloading reference genome....

wget -c ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/technical/reference/phase2_reference_assembly_sequence/hs37d5.fa.gz
gunzip hs37d5.fa.gz
wget -c ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/technical/reference/phase2_reference_assembly_sequence/hs37d5.fa.gz
gunzip hs37d5.fa.gz

check_md5sum
check_md5sum
)


###############################################################################
# download dbSNP database
# download Beagle database
###############################################################################
(
DBSNP_VERSION=135
mkdir_cd databases/dbSNP/dbSNP_$DBSNP_VERSION
mkdir_cd databases/Beagle_references

EXPECTED_MD5SUM=fed2a31b5a5d8fe12e072576c0c17199
check_md5sum && exit 0 || echo downloading dbSNP file....
EXPECTED_MD5SUM=529947b78dbedfb7a947b530da510887
check_md5sum && exit 0 || echo downloading Beagle reference files....

# CITATION
# As a NCBI Resource: "Sherry ST, Ward MH, Kholodov M, Baker J, Phan L, Smigielski EM, Sirotkin K. dbSNP: the NCBI database of genetic variation. Nucleic Acids Res. 2001 Jan 1;29(1):308-11."
# As a whole for a specific build (use this!) : "Database of Single Nucleotide Polymorphisms (dbSNP). Bethesda (MD): National Center for Biotechnology Information, National Library of Medicine. (dbSNP Build ID: 141 ). Available from: http://www.ncbi.nlm.nih.gov/SNP/"
# A single or a range of Submitted SNP (ss) or Reference SNP (rs) entries: "Database of Single Nucleotide Polymorphisms (dbSNP). Bethesda (MD): National Center for Biotechnology Information, National Library of Medicine. dbSNP accession:{ss1 or ss1 – ss100}, (dbSNP Build ID: 141). Available from: http://www.ncbi.nlm.nih.gov/SNP/"
for chr in {1..22}; do wget -c "http://bochet.gcc.biostat.washington.edu/beagle/1000_Genomes_phase3_v5a/b37.bref3/chr${chr}.1kg.phase3.v5a.b37.bref3"; done
wget -c "http://bochet.gcc.biostat.washington.edu/beagle/1000_Genomes_phase3_v5a/b37.bref3/chrX.1kg.phase3.v5a.b37.bref3"

# DOWNLOAD
DBSNP_BASE_URL="ftp://ftp.ncbi.nih.gov/snp/organisms/human_9606_b150_GRCh37p13/VCF"
wget -c "$DBSNP_BASE_URL/README.txt"
wget -c "$DBSNP_BASE_URL/00-All.vcf.gz"
check_md5sum
)

# POST PROCESSING
# extract SNPs from dbSNP version 135 and older
zcat 00-All.vcf.gz |
awk '/^#/{print} /VC=SNV/{ v=$8; sub(/.*dbSNPBuildID=/, "", v); sub(/;.*/, "", v); if (v~/^[0-9]+$/ && int(v)<='$DBSNP_VERSION') print }' |
bgzip > 00-All.SNV.vcf.gz
tabix -p vcf 00-All.SNV.vcf.gz
###############################################################################
# download genetic maps
###############################################################################
(
mkdir_cd databases/genetic_maps

EXPECTED_MD5SUM=37a6b0f29695cd87a3249065a1eae420
check_md5sum && exit 0 || echo downloading genetic maps....

# CLEANUP
rm -f 00-All.vcf.gz
wget -c "http://bochet.gcc.biostat.washington.edu/beagle/genetic_maps/plink.GRCh37.map.zip"
unzip plink.GRCh37.map.zip
rm plink.GRCh37.map.zip

check_md5sum
check_md5sum
)

###############################################################################
# download mappability file
# download dbSNP database
###############################################################################
(
mkdir_cd databases/UCSC
DBSNP_VERSION=135
mkdir_cd databases/dbSNP/dbSNP_$DBSNP_VERSION

EXPECTED_MD5SUM=3d12d0a4d7afdb52cfd10f886d48b5f0
check_md5sum && exit 0 || echo downloading mappability file....
EXPECTED_MD5SUM=fed2a31b5a5d8fe12e072576c0c17199
check_md5sum && exit 0 || echo downloading dbSNP file....

wget -c http://hgdownload.soe.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeMapability/wgEncodeCrgMapabilityAlign100mer.bigWig
bigWigToBedGraph wgEncodeCrgMapabilityAlign100mer.bigWig /dev/stdout | bgzip > wgEncodeCrgMapabilityAlign100mer_chr.bedGraph.gz
tabix -p bed wgEncodeCrgMapabilityAlign100mer_chr.bedGraph.gz
rm -f wgEncodeCrgMapabilityAlign100mer.bigWig
# CITATION
# As a NCBI Resource: "Sherry ST, Ward MH, Kholodov M, Baker J, Phan L, Smigielski EM, Sirotkin K. dbSNP: the NCBI database of genetic variation. Nucleic Acids Res. 2001 Jan 1;29(1):308-11."
# As a whole for a specific build (use this!) : "Database of Single Nucleotide Polymorphisms (dbSNP). Bethesda (MD): National Center for Biotechnology Information, National Library of Medicine. (dbSNP Build ID: 141 ). Available from: http://www.ncbi.nlm.nih.gov/SNP/"
# A single or a range of Submitted SNP (ss) or Reference SNP (rs) entries: "Database of Single Nucleotide Polymorphisms (dbSNP). Bethesda (MD): National Center for Biotechnology Information, National Library of Medicine. dbSNP accession:{ss1 or ss1 – ss100}, (dbSNP Build ID: 141). Available from: http://www.ncbi.nlm.nih.gov/SNP/"

check_md5sum
# DOWNLOAD
DBSNP_BASE_URL="ftp://ftp.ncbi.nih.gov/snp/organisms/human_9606_b150_GRCh37p13/VCF"
wget -c "$DBSNP_BASE_URL/README.txt"
wget -c "$DBSNP_BASE_URL/00-All.vcf.gz"

# POST PROCESSING
# extract SNPs from dbSNP version 135 and older
zcat 00-All.vcf.gz |
awk '/^#/{print} /VC=SNV/{ v=$8; sub(/.*dbSNPBuildID=/, "", v); sub(/;.*/, "", v); if (v~/^[0-9]+$/ && int(v)<='$DBSNP_VERSION') print }' |
bgzip > 00-All.SNV.vcf.gz
tabix -p vcf 00-All.SNV.vcf.gz

# CLEANUP
rm -f 00-All.vcf.gz

check_md5sum
)

###############################################################################
# download replication timings
# download mappability file
###############################################################################
(
mkdir_cd databases/ENCODE
mkdir_cd databases/UCSC

EXPECTED_MD5SUM=2a63b34a737383af2a3f7eb32801a5fa
check_md5sum && exit 0 || echo downloading replication timing file....
EXPECTED_MD5SUM=3d12d0a4d7afdb52cfd10f886d48b5f0
check_md5sum && exit 0 || echo downloading mappability file....

wget -c https://raw.githubusercontent.com/eilslabs/ACEseqWorkflow/github/installation/ReplicationTime_10cellines_mean_10KB.Rda
wget -c http://hgdownload.soe.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeMapability/wgEncodeCrgMapabilityAlign100mer.bigWig
bigWigToBedGraph wgEncodeCrgMapabilityAlign100mer.bigWig /dev/stdout | bgzip > wgEncodeCrgMapabilityAlign100mer_chr.bedGraph.gz
tabix -p bed wgEncodeCrgMapabilityAlign100mer_chr.bedGraph.gz
rm -f wgEncodeCrgMapabilityAlign100mer.bigWig

check_md5sum
check_md5sum
)

###############################################################################
# download chromosome statistics
# download replication timings
###############################################################################
(
mkdir_cd stats
mkdir_cd databases/ENCODE

EXPECTED_MD5SUM=801bdaa8c3b0d5c18a0637b0b29fd337
check_md5sum && exit 0 || echo downloading stats files....
EXPECTED_MD5SUM=2a63b34a737383af2a3f7eb32801a5fa
check_md5sum && exit 0 || echo downloading replication timing file....

wget -c http://hgdownload.cse.ucsc.edu/goldenPath/hg19/database/chromInfo.txt.gz
zcat chromInfo.txt.gz | grep -Pv "(_)|(chrM)" | sed -e '1i\#chrom\tsize\tfileName' > chrlengths.txt
rm -f chromInfo.txt.gz
wget -c https://raw.githubusercontent.com/eilslabs/ACEseqWorkflow/github/installation/ReplicationTime_10cellines_mean_10KB.Rda

wget -c https://raw.githubusercontent.com/eilslabs/ACEseqWorkflow/github/installation/hg19_GRch37_100genomes_gc_content_10kb.txt

check_md5sum
check_md5sum
)

###############################################################################
# download IMPUTE database
# download chromosome statistics
###############################################################################
(
mkdir_cd databases/1000genomes/IMPUTE
mkdir_cd stats

EXPECTED_MD5SUM=261a28d6b6917340cd82ada2d7185e17
check_md5sum && exit 0 || echo downloading impute files....
EXPECTED_MD5SUM=801bdaa8c3b0d5c18a0637b0b29fd337
check_md5sum && exit 0 || echo downloading stats files....

wget -c https://mathgen.stats.ox.ac.uk/impute/ALL.integrated_phase1_SHAPEIT_16-06-14.nomono.tgz
tar -xzvf ALL.integrated_phase1_SHAPEIT_16-06-14.nomono.tgz
rm -f ALL.integrated_phase1_SHAPEIT_16-06-14.nomono.tgz
wget -c http://hgdownload.cse.ucsc.edu/goldenPath/hg19/database/chromInfo.txt.gz
zcat chromInfo.txt.gz | grep -Pv "(_)|(chrM)" | sed -e '1i\#chrom\tsize\tfileName' > chrlengths.txt
rm -f chromInfo.txt.gz

wget -c https://mathgen.stats.ox.ac.uk/impute/ALL_1000G_phase1integrated_v3_impute.tgz
tar -xzvf ALL_1000G_phase1integrated_v3_impute.tgz
rm -f ALL_1000G_phase1integrated_v3_impute.tgz
wget -c https://raw.githubusercontent.com/eilslabs/ACEseqWorkflow/github/installation/hg19_GRch37_100genomes_gc_content_10kb.txt

check_md5sum
check_md5sum
Comment thread
vinjana marked this conversation as resolved.
)

echo "All files downloaded successfully"
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from python_modules import Tabfile

parser=argparse.ArgumentParser(description = "Add imputed haplotypes")
parser=argparse.ArgumentParser(description = "Add phased haplotypes")
parser.add_argument('--inputsuffix', '-i', type = str, help = "suffix of vcf file with phased genotypes")
parser.add_argument('--inputpath', '-p', type = str, help = "path and prefix to vcf file with phased genotypes")
parser.add_argument('--out', '-o', default=sys.stdout, help = "Output file. Default: STDOUT")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#chromosome start end rec
2 95574244 96074272 2906
2 131432422 132252426 2910
11 48878445 50210921 2909
14 21896742 22531023 159
15 24084780 24584944 2910
18 14119958 14910027 2910
19 42705844 43295853 2910
23 90094938 90885199 2909
23 92274954 93125000 2862
Empty file.
11 changes: 11 additions & 0 deletions resources/analysisTools/copyNumberEstimationWorkflow/bashLib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Copyright (c) 2017 The ACEseq workflow developers.
# Distributed under the MIT License (license terms are at https://www.github.com/eilslabs/ACEseqWorkflow/LICENSE.txt).

dieWith() {
local ec="${2:-$?}"
local msg="${1:?No error message}"
Comment thread
NagaComBio marked this conversation as resolved.
Outdated
echo "$msg: exit code $ec" >> /dev/stderr
exit "$ec"
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/python

import argparse

def is_comment_line(line):
return line.startswith("#")

parser = argparse.ArgumentParser()
parser.add_argument('--in_file', help='Input .vcf file')
parser.add_argument('--out_file', help='Out .vcf file')
args = parser.parse_args()

vcf_infile = open( args.in_file, "r" )
outfile = open( args.out_file, "w" )
Comment on lines +13 to +14

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using the with statement for opening files. This ensures that the file is properly closed after it is no longer needed.

- vcf_infile = open( args.in_file, "r" )
- outfile    = open( args.out_file, "w" )
+ with open(args.in_file, "r") as vcf_infile, open(args.out_file, "w") as outfile:

Commitable suggestion

[!IMPORTANT]
Carefully review the code before committing. Make sure it correctly replaces the highlighted code, has no missing lines and indentaion issues.

Suggested change
vcf_infile = open( args.in_file, "r" )
outfile = open( args.out_file, "w" )
with open(args.in_file, "r") as vcf_infile, open(args.out_file, "w") as outfile:


for vcf_line in vcf_infile:

if is_comment_line(vcf_line):
if vcf_line.startswith("#CHROM"):
vcf_line = vcf_line.rstrip().split("\t")
vcf_line.append('sample0')
Comment thread
vinjana marked this conversation as resolved.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "fake" sample name 'sample0' is hardcoded. Consider making this configurable through a command-line argument for flexibility.

- parser.add_argument('--out_file', help='Out .vcf file')
+ parser.add_argument('--out_file', help='Out .vcf file')
+ parser.add_argument('--sample_name', default='sample0', help='Sample name to be added')
...
- vcf_line.append('sample0')
+ vcf_line.append(args.sample_name)

Commitable suggestion

[!IMPORTANT]
Carefully review the code before committing. Make sure it correctly replaces the highlighted code, has no missing lines and indentaion issues.

Suggested change
vcf_line.append('sample0')
parser.add_argument('--out_file', help='Out .vcf file')
parser.add_argument('--sample_name', default='sample0', help='Sample name to be added')
...
vcf_line.append(args.sample_name)

vcf_line = "\t".join( vcf_line )+"\n"

else:
vcf_line = vcf_line.rstrip().split("\t")
vcf_line.append(vcf_line[9])
vcf_line = "\t".join( vcf_line )+"\n"

outfile.write( vcf_line )
Loading