<commit_before>#!/bin/sh
ref=$1
bam=$2
out_vcf=$3

b=`basename $out_vcf .vcf`;

if [ "$out_vcf" = "" ]; then
  echo usage: $0 ref.fasta query.bam out.vcf;
  exit 1;
fi;

if [ -e "$out_vcf" ]; then
  echo "Found $out_vcf! I will not rewrite it."
  exit 0;
fi;

# freebayes params
minAltFrac=0.95
minCoverage=10
readSnpLimit=3;
echo "TODO: put minAltFrac and minCoverage as parameters to launch_all.pl"

# for filtering, for later
new_vcf="$out_vcf".tmp
bad=$out_vcf".badsites.txt"

# freebayes
echo "Running Freebayes"
echo "$bam => $out_vcf"

freebayes       \
                `# input and output`\
                --bam $bam \
                --vcf $out_vcf \
                --fasta-reference $ref \
                \
                `# reporting` \
                --pvar 0 `# Report sites if the probability that there is a polymorphism at the site is greater than N.  default: 0.0001`\
                \
                `# population model`\
                --ploidy 1 `# Sets the default ploidy for the analysis to N.  default: 2`\
                \
                `# allele scope`\
                --no-mnps `# Ignore multi-nuceotide polymorphisms, MNPs.`\
                \
                `# indel realignment`\<commit_msg>added min alt frac and coverage as parameters<commit_after>#!/bin/sh
ref=$1
bam=$2
out_vcf=$3
minAltFrac=$4
minCoverage=$5

readSnpLimit=3;

b=`basename $out_vcf .vcf`;

if [ "$out_vcf" = "" ]; then
  echo usage: $0 ref.fasta query.bam out.vcf min_alt_frac min_coverage;
  echo "  where min_al_frac can be 0.75 and min_coverage can be 10"
  exit 1;
fi;

if [ -e "$out_vcf" ]; then
  echo "Found $out_vcf! I will not rewrite it."
  exit 0;
fi;

# freebayes params
if [ "$minAltFrac" = "" ]; then minAltFrac=0.75; fi;
if [ "$minCoverage" = "" ]; then minCoverage=10; fi;

# for filtering, for later
new_vcf="$out_vcf".tmp
bad=$out_vcf".badsites.txt"

# freebayes
echo "Running Freebayes"
echo "$bam => $out_vcf"

freebayes       \
                `# input and output`\
                --bam $bam \
                --vcf $out_vcf \
                --fasta-reference $ref \
                \
                `# reporting` \
                --pvar 0 `# Report sites if the probability that there is a polymorphism at the site is greater than N.  default: 0.0001`\
                \
                `# population model`\
                --ploidy 1 `# Sets the default ploidy for the analysis to N.  default: 2`\
                \
                `# allele scope`\
                --no-mnps `# Ignore multi-nuceotide polymorphisms, MNPs.`\
                \
                `# indel realignment`\
{'fraction_non_alphanumeric': 0.12166285278413425, 'fraction_numerical': 0.01792524790236461, 'mean_word_length': 1.7786016949152543, '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': '2442076', 'n_tokens_mistral': 987, 'n_tokens_neox': 888, 'n_words': 255}