<commit_before>#!/bin/bash

# cleans up after bcbio - when running large cohort only the final folder is kept
# and only one ensemble gemini database: 2-3G per family
# keeps bam files for new samples
# prepares tables for report generation

# parameters:
# family = [family_id] (=folder_name,main result file should be family-ensembl.db)

#PBS -l walltime=10:00:00,nodes=1:ppn=1
#PBS -joe .
#PBS -d .
#PBS -l vmem=10g,mem=10g

function cleanup
{

    # better to look for project-summary than hardcode the year
    # save bam files for new samples
    cd $family
    result_dir=`find final -name project-summary.yaml | sed s/"\/project-summary.yaml"//`
    mv $result_dir/* .
    mv final/*/*.bam .
    mv final/*/*.bai .

    rm -rf final/
    rm -rf work/

    #don't remove input files for new projects
    #rm -rf input/

    # we don't need gemini databases for particular calling algorythms
    rm ${family}-freebayes.db
    rm ${family}-gatk-haplotype.db
    rm ${family}-samtools.db
    rm ${family}-platypus.db

    cd ..
}

function prepare_for_report
{
    cd $family

    gemini.gemini2txt.sh ${family}-ensemble.db
    gemini.variant_impacts.sh ${family}-ensemble.db
    gemini.refseq.sh $family

    #decompose first for the old version of bcbio!
    #gemini.decompose.sh ${family}-freebayes.vcf.gz
    vcf.freebayes.getAO.sh ${family}-freebayes-annotated-decomposed.vcf.gz

    #gemini.decompose.sh ${family}-gatk-haplotype.vcf.gz
    vcf.gatk.get_depth.sh ${family}-gatk-haplotype-annotated-decomposed.vcf.gz

    #gemini.decompose.sh ${family}-platypus.vcf.gz
    vcf.platypus.getNV.sh ${family}-platypus-annotated-decomposed.vcf.gz

    cd ..
}

if [ -z $family ]<commit_msg>	modified:   bcbio.cleanup.sh<commit_after>#!/bin/bash

# cleans up after bcbio - when running large cohort only the final folder is kept
# and only one ensemble gemini database: 2-3G per family
# keeps bam files for new samples
# prepares tables for report generation

# parameters:
# family = [family_id] (=folder_name,main result file should be family-ensembl.db)

#PBS -l walltime=10:00:00,nodes=1:ppn=1
#PBS -joe .
#PBS -d .
#PBS -l vmem=10g,mem=10g

function cleanup
{

    # better to look for project-summary than hardcode the year
    # save bam files for new samples
    cd $family
    result_dir=`find final -name project-summary.yaml | sed s/"\/project-summary.yaml"//`
    mv $result_dir/* .
    mv final/*/*.bam .
    mv final/*/*.bai .

    rm -rf final/
    rm -rf work/

    #don't remove input files for new projects
    #rm -rf input/

    # we don't need gemini databases for particular calling algorythms
    rm ${family}-freebayes.db
    rm ${family}-gatk-haplotype.db
    rm ${family}-samtools.db
    rm ${family}-platypus.db

    cd ..
}

function prepare_for_report
{
    cd $family

    #gemini.gemini2txt.sh ${family}-ensemble.db
    #gemini.variant_impacts.sh ${family}-ensemble.db
    #gemini.refseq.sh $family

    for f in *.vcf.gz;
    do
	tabix $f;
    done

    #decompose first for the old version of bcbio!
    #gemini.decompose.sh ${family}-freebayes.vcf.gz
    vcf.freebayes.getAO.sh ${family}-freebayes-annotated-decomposed.vcf.gz

    #gemini.decompose.sh ${family}-gatk-haplotype.vcf.gz
    vcf.gatk.get_depth.sh ${family}-gatk-haplotype-annotated-decomposed.vcf.gz

    #gemini.decompose.sh ${family}-platypus.vcf.gz
    vcf.platypus.getNV.sh ${family}-platypus-annotated-decomposed.vcf.gz

    cd ..
}

if [ -z $family ]
{'fraction_non_alphanumeric': 0.12384259259259259, 'fraction_numerical': 0.008680555555555556, 'mean_word_length': 3.0338389731621938, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3463663', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1259, 'n_words': 316}