Step1. Bin barcode ./binReads.sh fastqFolder barcodes 1 8 16 p7.index p5.index usedBarcodes where fastqFolder contains the fastq files and barcodes is the barcode index. Step2. Remove adaptor sequences workingDir=/home/jz57w/mccb/Zhu/Guide-seq/ScotWolfe/rep1/binned/R2 cd $workingDir for filename in *; do cutadapt -f fastq -b blue=TTGAGTTGTCATATGTTAATAACGGTAT -b red=ACATATGACAACTCAATTAAAC -b blueRevComp=ATACCGTTATTAACATATGACAACTCAA -b redRevComp=GTTTAATTGAGTTGTCATATGT -n 4 $filename > filtered_$filename done Step3. Map to the genome using bowtie2 and convert the alignment file to bed format with CIGAR inforamtion bowtie2 -p 16 --local --very-sensitive-local -x Bowtie2Index \ -1 filtered_GUIDEseq_R1.fastq -2 filtered_GUIDEseq_R2.fastq \ -S bowtie2.GUIDEseq.sam samtools view -bSq 30 bowtie2.GUIDEseq.sam > bowtie2.${tag[${i}]}.bam samtools sort bowtie2.GUIDEseq.bam bowtie2.GUIDEseq.sort samtools index bowtie2.GUIDEsq.sort.bam samtools sort -n bowtie2.GUIDEseq.bam bowtie2.GUIDEseq.sortname bedtools bamtobed -cigar -i bowtie2.GUIDEseq.sortname.bam > bowtie2.${tag[${i}]}.sort.bed Step4. Extract Umi sequence plus first 8 bases from the 5' end of the R1 read ./getUmi.sh testGetUmi 16 8