--- title: "13=igv" author: "Steven Roberts" date: "`r format(Sys.time(), '%d %B, %Y')`" output: github_document: toc: true toc_depth: 3 number_sections: true html_preview: true html_document: theme: readable highlight: zenburn toc: true toc_float: true number_sections: true code_folding: show code_download: true editor_options: markdown: wrap: sentence --- ```{r setup, include=FALSE} library(knitr) library(tidyverse) library(kableExtra) library(DT) library(Biostrings) library(tm) library(pheatmap) library(DESeq2) knitr::opts_chunk$set( echo = TRUE, # Display code chunks eval = FALSE, # Evaluate code chunks warning = FALSE, # Hide warnings message = FALSE, # Hide messages fig.width = 6, # Set plot width in inches fig.height = 4, # Set plot height in inches fig.align = "center", # Align plots to the center comment = "" # Prevents appending '##' to beginning of lines in code output ) ``` Need to index genome ```{r, engine='bash'} /home/shared/samtools-1.12/samtools faidx ../data/ncbi_dataset/data/GCF_031168955.1/GCF_031168955.1_ASM3116895v1_genomic.fna ``` ```{r, engine='bash'} /home/shared/samtools-1.12/samtools faidx ../data/ncbi_dataset/data/GCF_031168955.1/GCF_031168955.1_ASM3116895v1_genomic.fa ``` start of IGV (save as xml) ``` ``` ![](https://gannet.fish.washington.edu/seashell/snaps/IGV_2024-05-24_10-33-08.png) # Converting bams to bedgraph RUN OVERNIGHT ```{r, engine='bash'} # Directory containing your BAM files bam_directory="../output/10-hisat-deseq2" # Directory to store the resulting BEDGraph files output_directory="../output/13-IGV" # Create the output directory if it does not exist if [ ! -d "$output_directory" ]; then mkdir -p "$output_directory" fi # Loop over each BAM file in the directory for bam_file in "$bam_directory"/*sorted.bam do # Generate output filename by replacing .bam with .bedgraph bam_filename=$(basename "$bam_file") output_file="${output_directory}/${bam_filename%.bam}.bedgraph" # Run bedtools genomecov /home/shared/bedtools2/bin/bedtools genomecov -ibam "$bam_file" -bg > "$output_file" echo "Generated BEDGraph for $bam_file at $output_file" done echo "All BEDGraph files have been generated in $output_directory." ```