Submind YouTube summaries
Thumbnail for RNA-seq Analysis Montreal and St. John's 2026 | 02: RNA-seq alignment concepts and file formats

RNA-seq Analysis Montreal and St. John's 2026 | 02: RNA-seq alignment concepts and file formats

Watch on YouTube

Video summary

This module explores the fundamental strategies for RNA-seq analysis, distinguishing between mapping, pseudo-alignment, and de novo assembly as primary approaches to handling sequencing reads. Mapping utilizes tools like STAR or HISAT2 to align reads base-by-base against a reference genome, offering high positional accuracy essential for studying isoforms and variants but demanding significant computational resources; in contrast, pseudo-alignment methods such as kallisto and Salmon associate reads with transcripts without determining exact genomic positions, providing a faster and more resource-efficient solution ideal for quantification. When no reference is available, de novo assembly reconstructs transcripts from scratch, while the selection of an appropriate reference genome version ensures compatibility between FASTA files and annotations, requiring careful attention to differing chromosome naming conventions between UCSC and Ensembl databases that could otherwise lead to errors during processing. Following alignment, data management relies on specific file formats where SAM serves as a tab-separated text format containing eleven columns detailing read properties like flags, positions, mapping quality scores, CIGAR strings for matches or splicing events, and sequence information, whereas BAM represents the binary version of this data designed to save storage space. To visualize these datasets effectively in tools such as IGV or the UCSC Genome Browser, BAM files must be indexed; visualization allows researchers to inspect coverage on exons, examine splicing events across junctions, and verify read orientation, while alternative formats like BED/BEDGRAPH for genomic intervals, WIG/BIGWIG for continuous coverage, VCF for variants, and GTF/GFF for annotations facilitate comprehensive data management. Quality control is a critical step performed via log files or aggregated reports to ensure that over 70-80% of reads map uniquely, addressing potential issues such as contamination from unmapped reads caused by incomplete references or adapter sequences requiring trimming before mapping. The analysis workflow further incorporates specialized tools for manipulating genomic data, with bedtools acting as a versatile utility for finding intersections between files and SAMtools providing functions like view and merge to inspect BAM structures and combine replicates. Although merging BAM files can be useful for creating visual graphs, it is crucial that samples remain separate during the actual statistical analysis to maintain power; keeping them distinct enables researchers to identify specific issues within individual samples before final integration. Additionally, understanding PCR duplicates in RNA-seq requires distinguishing between biological occurrences due to high expression levels and technical artifacts, with Unique Molecular Identifiers offering a method to distinguish these if necessary. Ultimately, alignment alone holds no intrinsic meaning without rigorous quality control and interpretation, emphasizing the necessity for users to always inspect their data and alignment results thoroughly before proceeding to downstream analyses or drawing conclusions.
Read the full video transcript
So I hope you still have some energy for the last uh module of today. Uh so module two uh everything related to RACI alignments. Um so some concept and file format. So the learning objective of the module is to understand the key steps of a standard RNC pipeline. Uh also have a better idea of the different strategy. So you may have heard the term mapping assembly or psudo alignment. So I'm going to try to demystify this. Also a little bit of information about how to choose a reference genome uh that is adapted to your project. um some information about uh the different tools available uh for the mapping for example and also how to perform the quality control of your alignment. So the first step is to uh be sure you understand the differences between mapping assembly and sod alignment. So the alignment uh is the goal is to precisely align reads to the genome. So each read is aligned base by base to an exact position on the genome. So it's uh using a reference genome uh to map the reads. With uh this type of approach uh you can also discover uh new uh new transcript for example and it's uh relatively fast uh to compute this type of uh approach. So there is different tools available uh to perform uh alignments like ISAT 2 star uh and also bow tie. So depending on the application uh you will use either uh star or bow tie. So for RNA seek uh you should use tar or isat 2 because it's a spliceware softwares. So remember you're working with RNA seek in your uh mature RNA you only have exxons and you need to map these exons to a reference genome that is composed to uh with uh inrons enzones and endogenic regions. So there is uh a difference in the content of your sequence. When you are dealing with uh DNA like for the world genome sequencing uh you sequence exactly the content of the reference genome. So you can use a bow tie for example or uh BWE if you have heard of this one uh to map your reads against DNA. Uh the difference uh with sodo alignment uh is that you you are not mapping your reads to a reference genome. You are mapping your reads to a reference transcriptton. So instead of having all the uh uh exxone entron antigenic region you only have the coding region. So you are reducing the possibilities. So in this uh example here uh you are going to associate your reads with a transcript uh but you're not looking for the exact alignment. Okay? You don't care about the position. You just need to know that this reads is associated with this transcript. So that's why uh the output of such approach with a calisto or sailfish for example or salmon uh uh doesn't give a bum file in the end. It will just give you a canc of your transcript. So uh the advantage is that it's very fast because you are going to match your reads against a transcripttom only. So the main disadvantage is that you don't have a ban pile as an output. uh and you know sometimes you want to look at your data you want to look at your BAM file and it's not possible um but still you can create what they call the subtle BMS so to be still available to look at your classification and the last approach is what we call the assembly. So you can try to reconstruct the transcript uh from the read. So imagine you are working with a special uh organism and the reference genome or reference transcryto is not available. You can still sequence what is inside the organism and try to rebuild the transcript. So that's what we call denovo transcrytoics. There is different uh flavor of this uh type of approach. So if you're working with the a species and a relative organism is available, you can use for example a closed uh reference genome to at least have a draft of what it should look like. So it could be strictly denovo like I I don't have any idea what it is inside my reference transcriptton or it could be uh based on something that should looks like it. So it's very very useful. Uh and uh the main issue is that it's very uh um computationally expensive because you need to assemble small fra uh uh some small fragments into context. So you need to found the overlaps between your sequence and build the contig and then the reference transcriptto or the reference genome. So there is a lot of tools available trinity velvet spades some are more dedicated to bigger genomes some are more dedicated to meta genome for example in the bacteria uh so it depends on the application of uh of your research. So in this workshop we only focus on uh with reference genome. So we are going to use far and also uh salmon for the psudo alignment. So here I put a small uh overview of uh the different approach. Uh so for the uh mapping approach the alignment approach. So the accuracy of the position of your reads on the reference is very high. Okay. So you exactly know where each reads is aligned on the reference genome. The speed is I would say slow and the computing resources are high. So that means that it can be difficult for you to run such experiment on your own computer. Okay. Because it will takes too many resources. Uh regarding the application with RNA seek, you can look at the splicing uh at the variance uh look at the fine structure of your RNA. So it can be very uh uh really uh precise for the assembly. uh it can be uh accurate sometimes if you have uh a draft of the uh or a reference genome but sometime it's very complicated if you are working with something that has a lot of re combination for example uh it might be difficult to reconstruct the transcriptto also it's very very slow and very high on computing uh resource but uh it can help you discover he isopforms so that's something uh really important uh here and uh also for non-model organism there is no other option uh you need to sequence what is in your organism and try to find uh the transcript or the genome for the sodo alignment it's working very well uh it's very fast uh you can run this on your computer I'm pretty sure and you will get a transcript classification so if you're not looking for uh uh isopforms for different uh splicing uh usage uh you can just go straight to pod alignment and you will get a matrix with uh the classification of each uh transcripts I hope it's better now uh the main differences between these so a little bit about how to choose a reference genome so ludes this morning introduced it but I'm going to add some layers so when you are doing star alignment you need the reference genome. So how you choose that? So you might see in the literature on the different uh websites uh the naming uh for example GRC M39, MM10, MM39. So that might be confusing for all of you. So how you choose your uh reference from that? So there is different naming convention. So if you see something called MM9 or MM10, you know that this file comes from UCSC. That's the website. And uh what they did is that to name the chromosome, they use CHR and then the number of the chromosome. And this is very important because if you took a reference genome from UCSC a faster file but you use an annotation from ensemble for example it's not compatible because in ensemble they choose to name the chromosome just by the number there's no chr. So if you are using the two together you will have an error. So that's why it's very important to be consistent when you choose a resource for a reference genome you take both the faster file and the genome annotation. Um yes so on the different resources you will so uh you also see uh the patches. So for example we have grc38 patch 11. What does it mean a patch? That means that there is minor correction to this version. So uh instead of making a new version they are correcting some things on the genome. So uh they are improving the annotation. If there are major uh changes like they add uh uh nucleotides for example in the chromosomes they will release a new version. Okay. And it's important because if you have data from a previous version and you have identified uh for example a mutation okay that is at the position and you use a new version but in the new version they add more uh DNA so this position may have changed in the new uh reference genome. So be careful if you want to compare results from different genome version. uh sometimes the position may have changed and the annotation also may have changed. Uh I would add on this that uh if you are in a lab and they have done multiple experiments in the past and you want to compare your results with the results from uh from the lab uh you have different choices. So you can use the last version and then use tool to convert your result to the past one or you can realize everything if it's very old. I will uh advise to reanalyze everything with the last version of your reference genome because a lot of things are changing right now. So be careful when you want to integrate data. you know if you have 10 years of work done in the lab you might need to think about how you are going to uh integrate all of the results also sometimes it's not the best idea to use the last version uh as soon as it's released sometimes uh there is still issue with it so I will advise to maybe wait a little uh before using the last Okay. So for the mapping so we want to to uh align the reads to the reference genome. Uh but before uh being able to do that we need to do a step that is called the indexing. So if you take the human reference genome is it's three gigabytes of bases and on our side we have short sequence of 100 bases and the goal is to align this to three gigabytes. So we cannot use it uh uh as it is right now okay in a linear way. So to be able to align it uh they have used uh a way to organize the g reference genome that is called an index. So think of it like a dictionary. We are going to list all the words we see all the cameras we see in the reference genomes and we are sorting the cameras by alphabetically. So when we have a read we can directly go to the okay at the beginning of the read I have a hey a so I can directly go in the index to all the sequence that start with the a and it will help you know to find the right position of your reads. So that this is just an informatic trick to be able to resolve the issue of mapping million of reads to uh big genomes. Also uh you need to create this index for each tool and for each reference genome. So if you are going to use star with ecoli mouse human drosophila you will have to prepare your index for all these genomes. And if you are going to sequence them on different platforms or in different ways, you are going to prepare the genomes either for par parent 100 parent uh 50 and etc and etc. So you have to prepare these libraries okay these dictionaries but once you have create created these dictionaries you can you are going to use it again and again and again okay you have to do it this just once. So that's for one two but if later you need to use bow tie for example you did a chipsseek experiment you cannot use the star index you need to recreate one that is specific to this okay so you need to prepare each time your index file for each reference for each tool so we are going to do this tomorrow during the session we are going to create the index for our reference genome it's Okay. So, as I said, the goal of the mapping is to associate million of RS that are short uh usually around 100 uh base pair uh where with the reference genome. So, the output of the mapping is a a file that we called a SAM file. So, it's a format that was developed during uh the 1000 uh genome project. So years ago when they started to sequence uh more and more human genome uh they decided that it would be a good idea to have a common and a standard way to share this type of data. So uh at the time it's still the case all the mapping tools are using the SAM and BAM format as an output. So it's a file that would contain the alignment results. I will describe it later. Uh and then using this SAM or BAM file uh you will be able to count the reads per gene uh you'll be able to visualize your alignment with uh maybe a software software called IGB and you can perform uh also differential expression analyszis or uh even functional characterization. So everything start from this bounds. It's very important. So the SAM format it's for sequence alignment map formats and the BAM file is just a binary version of a SAM. So it's not uh very complicated and why they did that is just because to save space. If you are doing um a basic aristic experiment you will have around maybe 20 gigabyte of data to deal with. Uh so it's a good idea to reduce this uh amount. So uh they have some trick to reduce the space storage. So what is the sum? So this sum is a tab separated uh um text file with 11 uh tabs. Okay, that's very simple. But they encoded the different uh columns. So when you look at a SAM file, the first information is the identifier of the read. So it's a long name. For us, it doesn't mean anything. But uh what is important is that if you do a parent sequencing, the name sorry the name of the reads will be the same in the two fast q file. Okay. And the extension means it's coming from the same cdn. So that's the Q name. something important is the flag. So the flag will contain the properties of the read and uh they find a way to store this information uh in a very cle clever way. So they store one number in the in the example here uh we have the name of the read one and the flag is 163. On the left here you have a table where for each digit it describe the properties of the read and based on the digit here there is only one way to get 163. So it's a mathematical trick. So to get 163 I need to add 1 + 2 + 32 + 128. This is the only solution based on the digits that are listed here. Sorry. So if I want to translate 163, I just have to have the this table here and it will help me to understand uh what is the properties of these reads. So instead of storing all of this text here that takes a lot of space they just store 163. Why it is important to know that? Because for example you did an arnistic experiment and you have a contamination. Okay you did the alignment and you have maybe 20% of your reads unmapped. Using the flag you able to target the unmapped reads. So you will be able to use for example pick or tunes and say give me all the reads that are unmapped. So you use the flag I don't remember for example 32 and it will output all the unmapped reads. Using this unmapped reads you can now go for example to blast and try to find what is is coming from where it is coming from. So, uh I I I understand that it's a lot of information here, but there is a website online and you you click on the properties you want and it will give you the flag number very very easy. So, if you have an issue with your alignment or if you're interested in MAP grids because sometimes that's the goal. We want this map reads. Uh with this flag, you will be able to track them. [clears throat] The last column, the next column is the uh our name. So it's the chromosome of the reference sequence name. So for example here we can have chromosome one. Very simple. Then we have the position. So the start position of alignment and it's one based. So this is something uh very important. I don't know why but in the history some of the standard file are based on one. So the first position is one and for some other reference file the first position is zero. I think it's from the informatics uh site. So be careful depending on that if you are interesting in a specific position look at uh if it's one base or zero based uh reference file. Here you you will have the information or where is the alignment beginning. We have here one example. Then you have the map Q. So it's the confidence score of alignment. It can be high or low. And if you have a contamination again, maybe you're interested in low uh uh alignment uh reads. So it's a scale uh between zero and 60. The next uh information is I think uh very important. It's called the cigar. Uh and it will tell you how the the reads align to the reference genome. So I have an example here. I know it's complicated but it's 8 M 2 I 4 M1 D prem. So what it means? So if we took here in uh black you have the reference genome and in green and red you have the sequence uh of the read. So we are going to start with 8 M. 8 M means that the eight first position of the reads match perfectly with the reference genome. So instead of storing all of this information, we just store two characters 8 m because I know from the previous columns where the alignment begins. So I don't need this information here. I just need to know if it's a match or not. Then we have a two I. So I have an insertion in the read. A a G are only found in the read and they are absent in the reference genome. Then again 4 amp exactly the same sequence between the two. Then one it means there is a deation in the read. So I have a G in the reference and nothing in the read and the last three PM prematch. So instead of storing all of these characters I have this one. So here I took a very complicated example. Usually when you're doing a 100 parent sequencing you get 100 match. Okay. So it's not that complicated here. So if you are looking for mutation for example you can again use tools to extract the reads that have a cigar including uh for example uh substitution. So that's again a way to grab data from your B bar. Um the next columns um will give you the reference sequence of the matrix. So in the parent uh experiment uh so when you're doing parent sequencing you expect the pair to be aligned on the same chromosome. Okay? because it come from the same cDNA. But sometimes you have recombination. So especially in in cancer. So you can have one reads aligned to one chromosome and one reads aligned to another chromosome. And that's something that is interesting for someone working with cancer. So how to track that in a band? You are going to look at this field here where it says if the uh the pair is aligned to the same chromosome or not. So if you have an equal uh uh symbol it mean that the two reads from the same pair are aligned to the same chromosome and if not you will have a different information. So depending on your field that's something that could be helpful to extract uh your data. Um the next one is the position where the pair reads aligned. Uh so it's information about the other uh reads in the pair. So again it could help uh tracking it. And the last information is the distance distance between the two pair. So the two uh reads should align next to each other. And uh here it computes the distance distance between the two. So again if you think there was a re combination or insertion inside it could be a way also to track all the reads that have a high insert size. And the last one, the most important one is the here the sequence of your read with the quality. So the last two information were already stored in your fast q file. Okay. So they are still there in the b. We have the sequence and we have the quality of the sequencing uh using the same uh asi code to encode the uh quality. Okay. So during uh the labs we are going to look at the band files. So it would be more uh easier for you to understand what it is inside. So now that we have aligned the reads to uh the reference genome we need to look at the QC matrix. Why it is important to look at this? Because we want to be sure uh that the reads are correctly mapped to the reference genome. um we have at the facility analyze hundreds of projects and sometimes we make mistakes like we didn't choose the right reference genome. So we ended up with maybe just 50% of reads align because if you take the mouse and the human there is still homology between the two. So we still have some read that align but it's very important to look at the level of alignment on your reference genome because also it can rise issue with the contamination. So if you have a lot of unmapped reads it might uh be uh important to look for contamination. Um so it's very important so you look at your QC and if it good you can continue to classification and then differential analysis. If there is issue with your alignment you can try to improve it. So just to give you an idea of what we are expecting in term of quality when you're doing uh oric with you know samples in good shape uh we expect to have more than 70% of RITs uniquely mapped to uh the reference genome. um from what we see at the platform it's more uh about uh over 80% and sometimes uh to 90% of reads unique. So it's also depending on the uh on the genome. So when you are performing the alignment with star the main output is the bump file but it also gives you statistics about the alignment and this information is stored in a log pile. So you need to look at these statistics to uh assess the quality of your mapping. So each read will be classified in three categories. The first one and the main one is the unique reads. That means your reads align to only one position in your reference genome. So you are 100% sure that this reads belong to this gene. Okay. In the other categories you have multimap reads or you have a reads and they can align at different position with the same score. So you are not able to distinguish what is the best spot for your reads. You cannot decide. So this can happen. Okay. In the genome you have paralogues. So that's the genes with the same origin. So they are look alike. So sometimes it's difficult to uh choose between the two because the score is the same. So it's normal to have multimap reads at certain points. The last category of reads after the mapping is the unmapped reads. So that mean that this reads was never aligned to the reference genome. And this can mean different things. The first one is the contamination. So this read comes from another organism. So when you did your experiment, you may have contaminated your samples with another I don't know bacteria or something else. Okay. But also be careful. We say that the genome are complete. That's not the case. Okay. So we use a reference. Okay. on one side that we have built from what we have and there is still some gap in this reference files on the other side we are sequencing what is really inside our cells and that's different from what we have in the reference genome so it might be unmapped because it's not integrated in the reference genome because we are not able to reconstruct properly the reference genome okay so that's why there is still unmap reads when you are performing in such experiments because not all the genome is fully completed. Okay. So it's less and less the case with the tome torare uh consortion. Um uh so the idea of this construction was to sequence the chromosome from one end to to the other end. And to do so they use two different technologies. So the one that was presented this morning by by Lures uh with the short read sequencing by illuminina but they also use the long read sequencing from example from Nadop or Pac Bio uh to be able to track the low complexity regions that you played with a little bit this morning uh that are difficult to sequence with illuminina. So using these two technologies they are now releasing a more accurate version of genome uh of reference genome. So I think it's available for the human the mouse and they are working on the different model organism to improve the reference genome but for most of the data that was analyzed in the last decades it was on a version that was incomplete for all the model organism. Okay. So I think uh if you are going to reanalyze data from the past you might find uh interesting information uh related to the new content that is released because the data are in the raw data. Okay the data is not the reference is incomplete but the data are complete. So we might find uh interesting results in uh these data sets. So for the next step we are only focusing on the unique reads. So remember the goal of an arnistic experiment is to classify the genes. If I'm not able to decide if a reads belong to gene A or gene B, I cannot do anything with that. So we are going to trash everything that is multimap and unmapped. That's why we need the unique uh unique R uh proportion to be the highest possible because this is what we are going to use for the statistical tests. So we need a power to be able to distinguish differences. So as we have done with um the fast QC and fastp we can use multi QC to look at the log files here on the right and create nice graph again to help us because you you will have one log file per sample. So if you're doing six sample that's okay you can open six file if you are doing uh 45 samples you will think that's it's too much trouble. So again multiqc will aggregate all these log files in a nice uh graph. So this is what we see on the left here uh on the uh xaxis we have the million of reads in so the library size of each sample. So each line is one sample. So the main uh result here is the uh dark blue the uni uniquely mapped reads and that should be you know around 70% 80% of your total reads. So we see the other categories of uh reads. So the reads with an align proportion that is too short. So the reads align a little but not enough to be uh considered as a good match. uh also you have the align reads with different uh reason as I said so you choose the wrong reference genome uh you have a contamination uh you have the untrim adapters so again it's very important to remove them so think about your sequence you have uh sequence your cDNA and at the end there is something that is not in the reference genome the adaptors and it will uh interfere with your alignment because this sequence is not in your reference genome. That's why you need to remove them before the mapping. That is very important. Um so yes using multiqc we can see uh very briefly that we have more than 70% of uh uniquely mapped grids. So we are happy with your our QC. Um I put there some question I've seen a lot uh at the platform. uh why we don't remove the PCR duplicate in arenic so that's a process we do for chipsseek for example um and the answer is related to the biology so if you look at your transcript you don't have just one copy of your transcript in the cell you can have tens and thousand of copy of one transcript so if you think of it uh uh randomly if I select some fragments there is a chance that I have exactly the same sequence in the arnistic experiment. Uh but if you are doing a wall genome sequencing, you shouldn't have by chance twice times maybe this content. So often this duplicates are more biological duplicate because it's RNA. Um also in the in the total RNA you have you have highly expressed genes lowly expressed genes. So if you have highly expressed genes by chance uh with the sequencing you might end up sequencing more often the highly expressed genes. So again you will see them often and so it will increase the the risk to have exactly the same uh the the same sequence. So if we remove this variability that is a biology uh uh reason uh we will have bias when we are going to uh uh count for the level of expression. So it's not a good idea but good news there is a way to uh track this PCR duplicates. So that's something uh we can use during the library preparation that is called the UMI. So UMI stands for unique molecular identifier. So in the example on the right we have two sample A and B and we are going to use a different UMI for each RNA molecule. Okay. So we have a different color of for each one. So then when you are doing the library preparation you dep you do PCR cycle to increase your amount of cDNA or RNA and you see that you have artificially increase here the number of transcripts. I have three for the first one and in the in this one I just have two but initially I have exactly the same amount on the two sides. So using this I can uh use a tool called UMI tools uh that will track this sequence and it will keep only one UMI for each transcript. So in the end I will go back to just this amount of sequence and without the UMI it's not possible to see if it's because it's biologically three different transcripts or if it's because of the PCR but using the UMI inserted before the PCR we know that it comes from three different transcript so not all the platform are using UMI uh be careful pool also if you grab data from for uh gene expression omnibus look at the detailed description sometime they use um sometime not uh sometimes the affirmation is not uh well uh identified also on the read sequence so be careful uh when they mention uh you uh the last step is the visualization so once we have the BAM files we can look at the sequence. So in this example uh we have used IGV integrative genome viewer and we will need it tomorrow. So for tomorrow's session please install IGV on your computer. It's a free software. Uh we will need it to look at your BAM files. So Ludes already uh showed us some uh screenshot from that. But I just want to uh uh again screen everything. So uh you will be able to choose your reference genome. So uh they are already available. You just have to select your reference genome. If you work with a pens organism, you can also create your own reference genome. Okay, they are not all listed there, but all the model organism are available. You have the position on the chromosome. So you can just uh drag and uh move in the chromosome. You have a track that will show you the coverage. Uh that's something Les showed us uh this morning. Uh but here we see that we have a higher coverage on the exons. That's why we know that this is a marinistic experiment because we only have coverage on the exons. Then we have the track for uh the bum pile. So we see here the different reads. Okay. You see a line between here for example we have a line between two reads. It's not two reads. It's the same reads but it was spanning around two different exones. So one part is aligned to the read here on the left and one part is aligned on the read on the right. Okay. So with the line we know that this is a spanning read across an exon junction. Uh here we have the other example with nsplliced reads. We have a bigger exon on the right. So the reads are just aligned to this exos and at the bottom you have uh the gene track. So by default uh in IGV it's refsec annotation but you can import your own annotation. So if you have used a custom genome or uh you prefer a reference from another resource you can import this into IGV. So you can pretty much do everything you know import different data files in IG. So when you are using IGV there is different thing you can uh look at uh you need to check uh the exon coverage. So if you have done arinistic you expect to see coverage only on exons uh and also you need to look at the splicing. So that's what I've showed. you have ex you have reads that are spanning across a junction. Um so it will help you you know confirm that uh you have done uh the right things here. Um also depending on the library preparation you should have a uniformity of coverage across the exoms but some library are more uh biased towards three prime sequencing. So it's not always the the case but usually we see uh uniform uh coverage across this. Um also the orientation of the reads on IGV should uh reflect the library orientation protocol. So that's something that might be difficult for you to get access to this information uh depending if you are doing the library preparation or not. uh if you are doing it by yourself, you know how your library is or oriented. If it was done as a as a platform, you will need to ask uh which protocol they use and you will be able to see if the orientation of the reads is as expected or not. We will see during the labs how to predict this information. So if you don't have access to a platform to confirm that this is the way they prepare the reads, uh there are tools that will predict the orientation of your uh reads uh that we need for classification. Um so with IGV you are able to open a lot of different uh data files. So the main one is a bum file. uh I will be careful there. So tomorrow we are going to use our BAM file but remember it's a small data set. So with a real data set if you have an old computer uh you may have issue with your memory usage. So uh it might be better to use uh processed uh BAM files that we can convert to something that is smaller. So it's can it can be for example a big weak file that we uh don't that that don't have the information about the reads anymore. They just have the coverage information that we need. So for visualization it might be enough to have a big file and not the sequence of the read inside your file. So the bum is the main one and uh the bum file should be indexed. So as I said for uh the alignment we need to produce an index of the reference genome. It's the same with the BAM file to be able to read it correctly. Uh we need to help the software. So we will create an index of this B file. Uh we have the bet file. So again it's a tabulated file that can represent different type of information. Um for example it can be the annotation uh from another resource or you can for example combine your aristic experiment with a chipsseek experiment where you have identified picss that are enriched in your experiment and you may want to see if there is any correlation between the picss and the level of expression of the genes nearby. So you can use a bet files with the region of the picss and visualize everything in your IGB environment. Uh so as I said we can also convert the BAM files to the big wig. So it's a compressed uh version of your BAM files to just look at the coverage track. Uh we already have seen the GTF or the annotation. So you can import an indentation from another resource or if you have your if you have built your own annotation you can import this in it. Um the next format is more for uh mutation. So I don't know if you're interested in combining or seek uh level of expression of genes related to variants you have identified in your genome for example uh you can uh import a VCF pile that will uh list all the mutation you have identified in the genome so you can see if a mutation have an impact on your the level of expression of your gene and the last one is a fastafile so already introduced Uh that is uh um if you have done a custom uh genome that's often the case by the way uh people are using mouse where they have put gene inside. So sometimes we need to rebuild this gene this uh new reference genome using the new materials that was added. So we often need to add this uh in IGV. Do we have question? Yes. Yes. Go ahead. >> Do we still need to ask the platform for the orientation if you can figure it out? >> Uh it depends if you are able to Oh yes. Uh do we still need to ask the platform for the library orientation? If you are able to predict it by yourself. So if you are comfortable using this type of tools, yes, go ahead and use the prediction. It works very well if you are using the right parameters. We will show you this uh tomorrow. Uh but if you are unsure on how to use it, please ask the platform. They know how they have done the library preparation and they will help you to contract this. Another question. >> Why are there >> Oh, okay. I'm going to switch this again. Yes. uh so it might be an artifact but sometimes oh yeah why we have in reads in the entronic regions in this case so we see here in the IGB capture I have some reads uh spanning here uh so there might be different reason explaining why we have uh this here on the graph uh but uh sometime it's very interesting so if you have a mutation in an in an entrance it might disrupt the splicing of your RNA So in some cases you will have reads uh mapped to the entrance because of a mutation and in some uh research areas that's something they are looking for. So that's uh that's also why you are looking at data uh it's important to see where are these maps. So you can use tools to track the reads that are mapped to entrons to identify them because you're not going to scroll over all your genome. Uh you will uh make test to identify the different region and then you can go back to IGV and make nice figure and visualize where your inference was retained in this examples but it might be also an active act you know. Yes. >> Yes. So, uh the question is why is it decreasing? So, I said that the coverage should be uh less or more equal over the genes but as I said uh we also see a bias toward toward the end of the genes in library preparation. So, there is degradation. So we we don't always have access to the beginning of each gene in the in the experiment. It's al it depends also in the uh in the size of the exoms because again it's a random sequencing. So by chance we are more going to capture long ex. So that's why also we have we don't have a lot of information on the small smaller ones. So that's a combination of all of this once more. Okay. Yeah. So you can use different tools to visualize your B files. IGV is a software that you can install for free on your computer. So if you have your data on your computer, use IGV. But if you have your data available on uh public websites, uh I would advise maybe to use more UCSC uh genome browser uh because you can link uh your public uh data sets to UCS. Also something very interesting with UCSC is that uh they are storing a lot of tracks from other uh projects. So you can visualize uh both your experiment and add layers from other projects. So for example I know they have track uh the level of expression in normal tissue for example in human. So you can add in UCSC a track where you see the level of expression in all the tissue in the human for example. So there is different project that are available in UCSC. So depending on your research area you can add them to your tracks. So that's also something uh you don't have to do the job, you know, it's already there available. You just need to select the ones you want to highlight and it's might be easier. Done. Okay. Um yeah, a little bit more information about the bed uh format. So again uh they decided to uh create this format but it's based on zero. So the first position on the chromosome is a zero. And how it works it's three at least three columns. So a bed file can be with additional columns but the minimum is three columns with the chromosome name the position the start position and the end position. But you can add other information like uh the intensity of a peak uh in this region or the level of expression. So the number of reads in this regions. Uh it can be also uh some something more binary like a motive of interest is present or not in this region etc and etc. So think about uh you can store a lot of information related to a position in the genome. the bed graph is a little bit different but the same ID uh so in this case it's again based on zero and instead of uh having here uh one uh each position listed we can combine here the information and we have uh here we know that on chromosome 3 at this position we had 11 reads mapped to this position. So it's a condensed information in this case and we can do again better. So why we do that? Why we have a lot of uh uh file types here? Because uh we are dealing with huge data. So we need to find a way to reduce this information at the minimum we need. So we can convert the bed graph to a wig format. And in in this case it's very very uh small information. We still have the same information. We have the chromosome 3. We know the starting point of this file and we have the coverage for each position. And we know we are doing a stepby-step uh increasing. So that means that the at the position uh 601 we have a coverage of 11 and at the next position we have a coverage of 22. So instead of keeping all of this information you know all the position that is redundant I just combine everything and it it will keep uh it will takes less space uh for the storage. I I think you don't see the issue but you know when you are do dealing with NGS data it's going uh very very very huge at some point. So that's why we needed that. If you're doing a war genome sequencing for a human, it's 200 gigabytes at least. So, you know, it's a lot. If you're doing a cohort with a lot of patients, it's going to be a lot to handle. So, that's why they define a lot of formats. So to be able to play with these uh different file types uh they have developed uh tools to be able to interact and convert one file to another ones. Uh so during the labs we are going to manipulate some of these tools. Uh the first one is SAM tools. Uh so it's in the name it's everything related to a SAM file or BAM file. So with the SAM tools you will be able to look at a SAM file or a B file. You will be able to index your BAM file. So as I said you need to index your B file to be able to view it in IGV. And also you can convert with some tools a SAM to a BAM file. Some tools I don't know why uh the output is a SAM file and it's huge. So we need to convert this to a BAM file. So usually we do the alignment and then we add another uh command line where we convert the SAM file into the BAM file. The next tools is the BAM tools. There is a lot of option again but uh the uh main uh use is to manipulate the BAM files to extract uh information from the BAM. uh something that we will not use in the labs but but that is still very used in the por uh picar tools uh so it's a java uh application uh but there is a lot of function related to to p uh so if you are going to analyze a lot of uh ngs data I'm pretty sure you will have to use uh par at some point so with par you can do qc metrics uh you can manipulate your your bands identify your uh duplicate ates for your PCR duplicates. Uh so there's a lot of application for for this tool. Uh and the last one are to manipulate the bed files. So it's called the bed tools. Uh at least they make it this very simple. Uh so when you want uh for example an intersection between two different bed files uh you can use bet tools and it will gives you uh the intersection between uh the different position. uh you know there is a lot of application but I think it's very important for you also to know that those are the Swiss army knife for um the manipulation of all these files. Um so for the SAM tools uh we are going to use the view function. As I said the BAM files are binary are binary files. So a binary files is not openable you know on your computer. You need an interpreter to be able to see the content of the file. So some tools is the tools to be able to look at what is inside your BAM files. If you click on a BAM file you will see a lot of characters and nothing makes sense. So you need a samples. So we are going to use it tomorrow uh to be able to look at the BAM structure. So the 11 field I described. So we are going to navigate a little inside the files. Um it's also useful when when you want to merge BAM files. So in our case we have three replicates uh per condition and in the end we want to merge everything in one B file to make nice uh graphs. So we can use samp tools merge to be able to create just one band even if we have aligned independently our sample. I see there is not a question but why we have aligned them separately if in the end we are merging everything together because analyzing them separately uh we are able to see if there is any problem with one sample or not if there is any issue so that's why we need to keep them separated but for the visualization it's it's not an issue we can merge them to make a nice graph but for the analysis we need the power the statistical ical power. So we need the uh three sample per condition for the statistical test. So we we cannot merge all them together. I put other uh example but I think the main one were uh important here. So is there any other question in the uh so the take-h home message if if I can make this very simple. So the alignment maps the reads to the genome but uh the quality and the interpretation determine its value. So without the quality and the interpretation there is no meaning on doing an alignment. It's very important to look at your alignment to do your QC before doing anything else. So stop at this point and look at your data. That's the best advice I can give you. Always look at your data at your files. That's very important. Uh so if there is no other question no so I'm done a little bit earlier but >> so any question from here should go into the slack so if there is no question in the slack we are good >> okay perfect thank you This [laughter] I