BEDTOOL

Command table

CommandDescription
/P/y14/term3/block4/SNP/bedtools2/bin/bedtools bamtobed -i chr9_sort.bam > chr9_sort.bed bedtools bamtobed is a conversion utility that converts sequence alignments in BAM format into BED, BED12, and/or BEDPE records.
/P/y14/term3/block4/SNP/bedtools2/bin/bedtools intersect -c -a /P/y14/term3/block4/SNP/rnaseq_reads/gencode.genes.bed -b chr9_sort.bed | grep "^chr9" | grep -vE '\s0$' > count.bed bedtools intersect allows one to screen for overlaps between two sets of genomic features. Moreover, it allows one to have fine control as to how the intersections are reported. For each entry in A, report the number of hits in B. Reports 0 for A entries that have no overlap with B. Then we select the rows with the data of interest - chr9 with a coverage more than 0.
/P/y14/term3/block4/SNP/bedtools2/bin/bedtools intersect -u -a /P/y14/term3/block4/SNP/rnaseq_reads/gencode.genes.bed -b chr9_sort.bed > inter.bed The same as the previous commend but -u writes original A entry once if any overlaps found in B. In other words, just reports the fact at least one overlap was found in B.
/P/y14/term3/block4/SNP/bedtools2/bin/bedtools sort -i inter.bed > inter_sort.bed sortBed sorts a feature file by chromosome and other criteria.
/P/y14/term3/block4/SNP/bedtools2/bin/bedtools merge -c 5 -o distinct -i inter_sort.bed > inter_merged.bed combines overlapping or “book-ended” features in an interval file into a single feature which spans all of the combined features. -c Specify columns from the input file to operate upon (see -o option, below). Multiple columns can be specified in a comma-delimited list. -o Specify the operation that should be applied to -c.
/P/y14/term3/block4/SNP/bedtools2/bin/bedtools intersect -c -b chr9_sort.bed -a inter_merged.bed > cover.bed Coverage

Results of the last command:

chr9	131445703	131458679	SET	13351   
               

Genes information

SET
Transcript IDENST00000322030.8
Length, bp7162
Transcript Length, bp2,915
TranslationLength, aa277
Coordinats, strainChromosome 9: 131,451,505-131,458,667 forward strand.
FunctionMultitasking protein, involved in apoptosis, transcription, nucleosome assembly and histone chaperoning.
Exons8
ProductThis gene has 11 transcripts (splice variants).

Additional (no) tasks

CommandDescription
/P/y14/term3/block4/SNP/bedtools2/bin/bedtools bamtofastq -i chr9_sort.bam -fq out.fastq bedtools bamtofastq is a conversion utility for extracting FASTQ records from sequence alignments in BAM format.
/P/y14/term3/block4/SNP/bedtools2/bin/bedtools getfasta -fi chr9.fasta -bed chr9_sort.bed -fo out.fasta extracts sequences from a FASTA file for each of the intervals defined in a BED/GFF/VCF file.
/P/y14/term3/block4/SNP/bedtools2/bin/bedtools cluster -s -i chr9_sort.bed > cluster.bed report each set of overlapping or “book-ended” features in an interval file. In contrast to merge, cluster does not flatten the cluster of intervals into a new meta-interval; instead, it assigns an unique cluster ID to each record in each cluster. This is useful for having fine control over how sets of overlapping intervals in a single interval file are combined.

Contacts: vorobiovarita@kodomo.fbb.msu.ru

© vorobiovarita 2018