Process 3'RNA-4tU experiments

Output directory structure:

PROJECT_ROOT/
  reads/<seqrun>.<outer-barcode>.<inner-barcode>.reads.gz with fields: index,seq,qual,umi,inner-bc,outer-bc,..illumina-info...
  processed/ processed data
    scer/
      features.tab - a bed file denoting stranded genomic features in bed format. md5 status is monitored for consistency.
      feature_sets.tab - collections of genomic features. md5 status is monitored for consistency.
      feature_set_assoc.tab - set membership in table format. md5 status is monitored for consistency.
      alignments/ ACG-only aligned reads with their alignments and additional information
      intersection/ association tables between alignments and genomic features
    klac/
      features.tab - a bed file denoting stranded genomic features in bed format. md5 status is monitored for consistency.
      feature_sets.tab - collections of genomic features. md5 status is monitored for consistency.
      feature_set_assoc.tab - set membership in table format. md5 status is monitored for consistency.
      alignments/ ACG-only aligned reads with their alignments and additional information
      intersection/ association tables between alignments and genomic features
  stats/
    seqruns/ <seqrun>.<stat>.tab.gz
    libraries/ <seqrun>.<outer-barcode>.tab.gz
    samples/ <seqrun>.<outer-barcode>.<inner-barcode>.tab.gz

WWW_ROOT/
  seqruns/
    <seqrun>
  libraries/
    <seqrun>/
      <outer-barcode>
  experiments/
   ...


Relevant Entities:
=================
  Experiment - A collection of samples that were collected simoultaniously and are
               expected to be analyzed together.

  Sample     - A description of cells: strain, OD, media, and other variables (time since X, etc.)
  
  Library    - A pooled RNAseq library of multiple samples.

  SeqRun     - A sequencing run


Tools:
=================
split_seqrun  - A script that executes bcl2fastq per sequencing run
                 Usage:
                   $ split_seqrun <seqrun_id>
                 Output: 
                   Generates a folder "PROJ_ROOT/SeqRuns/<date>_<seq-id>" with a fastq file per barcode+R1/2 
                   Prints the number of reads per barcode to stdout.

split_seqruns - Apply split_seqrun to multiple seqrun_ids in parallel
                 Usage:
                   $ split_seqruns id1 id2 id3 
                 Output: 
                   Prints the number of reads per barcode, date, id

split_samples -  A script that splits a list of fastq file pairs (after bcl2fastq) to sample fastq files
                 Usage:
                   $ split_samples <file_list> <exp-name> <exp-date> <sample_db>
                 Output:
                   Generates/overrides a file "PROJ_ROOT/fastq/<exp-date>_<exp-name>_<sample-id>.fastq.gz" per
                   sample in the sample_db input. 

align_reads   -  A script that performs the basic read-level operations
                 * align to modified reference genome
                 * align to spike in genome
                 * identify and count read duplicates
                 Usage:
                   $ align_reads <fastq_file> | gzip > <output-path>.tab.gz
                 Outputs:
                   $ a tab delimited file with a row per alignment (see -h)

filter         - Filter a table by column conditions
                 Usage:
                   $ zcat /path/to/file.tab.gz |
                     filter_aln "is_read_dup=0,<genome>_unique_aligned=1,strand=+" |
                     <pipeline continues...>

aln2bw         - Generate strand-specific bigwigs
                 Usage:
                   $ zcat /path/to/file.tab.gz | aln2bw <genome> <chr-sizes> <output.bw>

bw2peaks       - Call RNA peaks from bigwig
                 Usage:
                   $ bw2peaks <input.w.bw> | paste "+" | gizp > <output.bed.gz>

collect        - A script that aggregates alignments per query entry and a combination of alignment properties
                 Usage:
                   $ zcat alns.tab.gz | filter | collect annots.bed | gzip > annot.cnts.tab.gz
                 Outputs:
                   a tab delimited file with a row per annotaion and combination of aggregated properties

stats          - Output various sample statistics files
                 Usage:
                   $ cat alns.tab.gz | stats <output-dir>
                 
process        - A convenience script that performs all the common sample-level operations.
                 Usage:
                   $ process /path/to/fastq_file  


tab-delimited file with <seqrun_id>, <external-barcode> 
                    Outputs:
         
expects a list of seqruns and library barcodes generates 
