<commit_before>#!/bin/bash

# usage: bash /PATH/PostDCSProcessing.sh in_file ref_genome minDepth minClonality maxClonality

clear
#Path to PicardTools:
picard=/Users/LoeblabM11/Desktop/bioinformatics/programs/picard-tools-1.70

#Path to GATK:
gaTK=/Users/LoeblabM11/Desktop/bioinformatics/programs/GATK

#Path to reference genome:
refGenome=$2 #enter full path

progPath=${0%%PostDCSProcessing.sh}
echo 'Generating Analysis'
echo
echo 'File is: ' $1
echo 'Reference Gemone is: '$refGenome
echo 'Minimum Depth: '$3
echo 'Minimum Clonality: '$4
echo 'Maximum Clonality: '$5
echo

#----------------filter for maping reads---------------
echo 'Filtering:'
samtools view -F 4 -b $1 > ${1/.aln.sort.bam/.filt.bam}

#----------------clipping final file---------------
echo 'Clipping Final File:'
java -jar $picard/AddOrReplaceReadGroups.jar INPUT=${1/.aln.sort.bam/.filt.bam} OUTPUT=${1/.aln.sort.bam/.filt.readgroups.bam} RGLB=UW RGPL=Illumina RGPU=ATATAT RGSM=default

java -Xmx2g -jar $gaTK/GenomeAnalysisTK.jar -T ClipReads -I ${1/.aln.sort.bam/.filt.readgroups.bam} -o ${1/.aln.sort.bam/.filt.readgroups.clipped.bam} -R $refGenome --cyclesToTrim "1-5,71-80" --clipRepresentation HARDCLIP_BASES --fix_misencoded_quality_scores --unsafe

#----------------generating stats from final file---------------
samtools mpileup -B -d 500000 -f $refGenome ${1/.aln.sort.bam/.filt.bam} | tee ${1/.aln.sort.bam/.filt.pileup} | python $progPath/CountMuts.py -o ${1%%.aln.sort.bam}.filt.pileup.d${3}-c${4}-${5}.countmuts -d $3 -c $4 -C $5
python $progPath/CountMuts.py -i ${1/.aln.sort.bam/.filt.pileup} -o ${1%%.aln.sort.bam}.filt.pileup.d${3}-c${4}-${5}.unique.countmuts -d $3 -c $4 -C $5 -u

samtools mpileup -B -d 500000 -f $refGenome ${1/.aln.sort.bam/.filt.readgroups.clipped.bam} | tee ${1/.aln.sort.bam/.filt.readgroups.clipped.bam.pileup} | python $progPath/CountMuts.py -o ${1%%.aln.sort.bam}.filt.readgroups.clipped.bam.pileup.d${3}-c${4}-${5}.countmuts -d $3 -c $4 -C $5
python $progPath/CountMuts.py -i ${1/.aln.sort.bam/.filt.readgroups.clipped.bam.pileup} -o ${1%%.aln.sort.bam}.filt.readgroups.clipped.bam.pileup.d${3}-c${4}-${5}.unique.countmuts -d $3 -c $4 -C $5 -u

python $progPath/mut-position.py -i ${1/.aln.sort.bam/.filt.readgroups.clipped.bam.pileup} -o ${1%%.aln.sort.bam}.filt.readgroups.clipped.bam.pileup.d${3}-c${4}-${5}.mutpos -d $3 -c $4 -C $5<commit_msg>generic path in PostProcessing<commit_after>#!/bin/bash

# usage: bash /PATH/PostDCSProcessing.sh in_file ref_genome minDepth minClonality maxClonality

clear
#Path to PicardTools:
picard=/PATH/picard-tools-1.70

#Path to GATK:
gaTK=/PATH/GATK

#Path to reference genome:
refGenome=$2 #enter full path

progPath=${0%%PostDCSProcessing.sh}
echo 'Generating Analysis'
echo
echo 'File is: ' $1
echo 'Reference Gemone is: '$refGenome
echo 'Minimum Depth: '$3
echo 'Minimum Clonality: '$4
echo 'Maximum Clonality: '$5
echo

#----------------filter for maping reads---------------
echo 'Filtering:'
samtools view -F 4 -b $1 > ${1/.aln.sort.bam/.filt.bam}

#----------------clipping final file---------------
echo 'Clipping Final File:'
java -jar $picard/AddOrReplaceReadGroups.jar INPUT=${1/.aln.sort.bam/.filt.bam} OUTPUT=${1/.aln.sort.bam/.filt.readgroups.bam} RGLB=UW RGPL=Illumina RGPU=ATATAT RGSM=default

java -Xmx2g -jar $gaTK/GenomeAnalysisTK.jar -T ClipReads -I ${1/.aln.sort.bam/.filt.readgroups.bam} -o ${1/.aln.sort.bam/.filt.readgroups.clipped.bam} -R $refGenome --cyclesToTrim "1-5,71-80" --clipRepresentation HARDCLIP_BASES --fix_misencoded_quality_scores --unsafe

#----------------generating stats from final file---------------
samtools mpileup -B -d 500000 -f $refGenome ${1/.aln.sort.bam/.filt.bam} | tee ${1/.aln.sort.bam/.filt.pileup} | python $progPath/CountMuts.py -o ${1%%.aln.sort.bam}.filt.pileup.d${3}-c${4}-${5}.countmuts -d $3 -c $4 -C $5
python $progPath/CountMuts.py -i ${1/.aln.sort.bam/.filt.pileup} -o ${1%%.aln.sort.bam}.filt.pileup.d${3}-c${4}-${5}.unique.countmuts -d $3 -c $4 -C $5 -u

samtools mpileup -B -d 500000 -f $refGenome ${1/.aln.sort.bam/.filt.readgroups.clipped.bam} | tee ${1/.aln.sort.bam/.filt.readgroups.clipped.bam.pileup} | python $progPath/CountMuts.py -o ${1%%.aln.sort.bam}.filt.readgroups.clipped.bam.pileup.d${3}-c${4}-${5}.countmuts -d $3 -c $4 -C $5
python $progPath/CountMuts.py -i ${1/.aln.sort.bam/.filt.readgroups.clipped.bam.pileup} -o ${1%%.aln.sort.bam}.filt.readgroups.clipped.bam.pileup.d${3}-c${4}-${5}.unique.countmuts -d $3 -c $4 -C $5 -u

python $progPath/mut-position.py -i ${1/.aln.sort.bam/.filt.readgroups.clipped.bam.pileup} -o ${1%%.aln.sort.bam}.filt.readgroups.clipped.bam.pileup.d${3}-c${4}-${5}.mutpos -d $3 -c $4 -C $5
{'fraction_non_alphanumeric': 0.2274576997215678, 'fraction_numerical': 0.03384022274576997, 'mean_word_length': 3.3890977443609023, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5482559', 'n_tokens_mistral': 2071, 'n_tokens_neox': 1956, 'n_words': 368}