
Preparing annotations and reference sequences
=============================================

Adding 30 spike-in to the annotations and genome:

    annotations="genes_mm10_abundant_ncRNAs_spike_in.gtf"
    cat ~/Genomes/Mus_musculus/UCSC/mm10/Annotation/Genes/genes_and_mm10_abundant_ncRNAs.gtf spike_in.gtf > ${annotations}
    genome="mouse_genome_spike_in"
    cat ~/Genomes/Mus_musculus/UCSC/mm10/Sequence/WholeGenomeFasta/genome.fa real_sequence_in_vitro_transcripts.fa > ${genome}.fa

Indexing for bowtie2:

    bowtie2-build --seed 123 --packed ${genome}.fa ${genome}

Preparing the data
==================

    mkdir raw_data

I sent the `*.fq.gz` files from the archives in gironde2 to directory `raw_data`:
    
    # I did this as bli@sei-lot, where gironde2 mounting is configured
    rsync -vaP /media/gironde-2/RNA-Seq/C2C12/*.fq.gz herve.seitz@daisy:./Natalia/RNA-Seq/C2C12/raw_data/.

Associate sample letter to `*.fq.gz` files (excluding pilot sequencing):

    ls -1 raw_data | grep -v "MOU" | awk -F "" '{print $22"\traw_data/"$0}' | sort > sample2data.txt

Starting the analyses
=====================

The script `do_analyze_fused_replicates.sh` is in ~/Blaise/bin

    annotations="genes_mm10_abundant_ncRNAs_spike_in.gtf"
    genome="mouse_genome_spike_in"
    nb_procs="2"
    for sample in A B C D E F G H I
    do
        echo ${sample}
        fqgz_files=`awk -v sample=${sample} -F "\t" '$1==sample {print $2}' sample2data.txt` 
        script_args=`echo "${fqgz_files} ${sample} ${nb_procs} ${annotations} ${genome}" | tr '\n' ' '`
        cmd="do_analyze_fused_replicates.sh ${script_args}"
        echo ${cmd}
        # Only remove data if the analysis succeded
        eval ${cmd} && rm -f ${fqgz_files}
    done 1> analyze_fused_replicates.log 2> analyze_fused_replicates.err 
