Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Added the option -w to grep in order to filter for the exact sample names in the sample_config table
  • Loading branch information
sebastian-gregoricchio authored Oct 18, 2024
1 parent 81ef908 commit fcde6a6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions workflow/SPACCa_ChIPanalyses.snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ rule plotFingerprint:
mkdir -p 05_Quality_controls_and_statistics/plotFingerprint/logs
mkdir -p 05_Quality_controls_and_statistics/plotFingerprint/quality_metrics
INPUT_ID=$(grep {params.sample} {params.sample_config_table} | cut -f 2)
INPUT_ID=$(grep -w {params.sample} {params.sample_config_table} | cut -f 2)
$CONDA_PREFIX/bin/plotFingerprint \
-b {input.target_bam} \
Expand Down Expand Up @@ -860,8 +860,8 @@ if ((eval(str(config["bam_features"]["paired_end"])) == True)):
mkdir -p 04_Called_peaks/logs
INPUT_ID=$(grep {params.sample} {params.sample_config_table} | cut -f 2)
CALL_BROAD=$(grep {params.sample} {params.sample_config_table} | cut -f 3 | sed -e 's/\\(.*\\)/\\L\\1/')
INPUT_ID=$(grep -w {params.sample} {params.sample_config_table} | cut -f 2)
CALL_BROAD=$(grep -w {params.sample} {params.sample_config_table} | cut -f 3 | sed -e 's/\\(.*\\)/\\L\\1/')
if [ $CALL_BROAD == "false" ]; then
BROAD=""
Expand Down Expand Up @@ -905,7 +905,7 @@ else:
printf '\033[1;36m{params.sample}: calculating phantom peak...\\n\033[0m'
mkdir -p 04_Called_peaks/phantom/logs
INPUT_ID=$(grep {params.sample} {params.sample_config_table} | cut -f 2)
INPUT_ID=$(grep -w {params.sample} {params.sample_config_table} | cut -f 2)
${{CONDA_PREFIX}}/bin/Rscript ${{CONDA_PREFIX}}/bin/run_spp.R -rf -c='{input.target_bam}' -i="01_BAM_filtered/${{INPUT_ID}}{params.input_suffix}" -savp -out={output.phantom} &> {log.out}
"""
Expand Down Expand Up @@ -955,8 +955,8 @@ else:
mkdir -p 04_Called_peaks/logs
INPUT_ID=$(grep {params.sample} {params.sample_config_table} | cut -f 2)
CALL_BROAD=$(grep {params.sample} {params.sample_config_table} | cut -f 3 | sed -e 's/\\(.*\\)/\\L\\1/')
INPUT_ID=$(grep -w {params.sample} {params.sample_config_table} | cut -f 2)
CALL_BROAD=$(grep -w {params.sample} {params.sample_config_table} | cut -f 3 | sed -e 's/\\(.*\\)/\\L\\1/')
if [ $CALL_BROAD == "false" ]; then
BROAD=""
Expand Down Expand Up @@ -1276,7 +1276,7 @@ if ((eval(str(config["bam_features"]["paired_end"])) == True)):
mkdir -p 05_Quality_controls_and_statistics/peaks_stats/
# define peak file
CALL_BROAD=$(grep {params.target} {params.sample_config_table} | cut -f 3 | sed -e 's/\\(.*\\)/\\L\\1/')
CALL_BROAD=$(grep -w {params.target} {params.sample_config_table} | cut -f 3 | sed -e 's/\\(.*\\)/\\L\\1/')
if [ $CALL_BROAD == "false" ]; then
CALLING_MODE="narrow"
Expand Down Expand Up @@ -1360,7 +1360,7 @@ else:
mkdir -p 05_Quality_controls_and_statistics/peaks_stats/
# define peak file
CALL_BROAD=$(grep {params.target} {params.sample_config_table} | cut -f 3 | sed -e 's/\\(.*\\)/\\L\\1/')
CALL_BROAD=$(grep -w {params.target} {params.sample_config_table} | cut -f 3 | sed -e 's/\\(.*\\)/\\L\\1/')
if [ $CALL_BROAD == "false" ]; then
CALLING_MODE="narrow"
Expand Down Expand Up @@ -2280,7 +2280,7 @@ rule CopywriteR:
rm -r {params.outdir}/CNAprofiles
mkdir -p {params.outdir}
BROAD=$(grep {params.sample} {params.sample_config_table} | cut -f 3 | sed -e 's/\\(.*\\)/\\L\\1/')
BROAD=$(grep -w {params.sample} {params.sample_config_table} | cut -f 3 | sed -e 's/\\(.*\\)/\\L\\1/')
if [ $BROAD == "false" ]; then
EXT="narrowPeak"
Expand Down

0 comments on commit fcde6a6

Please sign in to comment.