Dinh:COMPUTATIONAL/umi procedure

From ZhangLabWiki
Jump to navigation Jump to search

UMI Procedure[edit]

  • UMIs are assumed to be the first N bases in read 1 ALWAYS.
  • Reads with UMIs are processed by getUMI.pl first. If the reads are PE, make sure that the PE reads are in order.
 For each read or pairs:
    record r1_name, r1_sequence, and r1_qualities
    record r2_name, r2_sequence, and r2_qualities
    assign umi = first N bases of r1_sequence
    append umi to r1_name and r2_name: umi_r1_name, umi_r2_name (first field separated by "_")
    remove first N bases from r1_sequence
    remove first N quality scores from r1_qualities
    print umi_r1_name, trimmed_r1_sequence, and trimmed_r1_qualities to *R1.fq file
    print umi_r2_name, r2_sequence, and r2_qualities to *R2.fq file
  • Afterwards, reads can be processed by adaptor trimming and mapping to get the sam file.
  • SAM files are processed for clonal removal by sam_UMI_filter_Poisson.pl
 Sort SAM files by mapping positions.
 Calculate the number of possible umi, (m)
 For each position mapped with more than 1 read mapped:
    extract umi from each read
    count how many times each umi are observed
    count how many unique umi are observed (k)
    calculate Po (the probability of a umi not being used) from the relations: k = m(1-Po)
    Use Po to calculate the absolute number of molecules (n) with the Poisson relation: Po = e^(-n/m)
    Since we know the absolute number of molecules (n), then:
            if number of reads is less than n, we allow all the reads. 
            if number of reads is greater than n:
                     start with allowing 1 read per umi
                     increase number of reads allowed until number of reads allowed is equal to n.
    print allowed reads to new SAM output file.
    move on to next position.
  • Output SAM file can be converted to BAM for further downstream processing.