An introduction to the statistics behind the most popular genomic data science projects. This is the sixth course in the Genomic Big Data Science Specialization from Johns Hopkins University.

Loading...

From the course by Johns Hopkins University

Statistics for Genomic Data Science

115 ratings

An introduction to the statistics behind the most popular genomic data science projects. This is the sixth course in the Genomic Big Data Science Specialization from Johns Hopkins University.

From the lesson

Module 1

This course is structured to hit the key conceptual ideas of normalization, exploratory analysis, linear modeling, testing, and multiple testing that arise over and over in genomic studies.

- Jeff Leek, PhDAssociate Professor, Biostatistics

Bloomberg School of Public Health

The first thing that you want to do when you get a dataset is explore it.

Â So I'm going to talk a little bit about how I explore data when I get it,

Â genomic data in particular.

Â So the first thing I'm going to do is I'm going to setup the plots so

Â they'll be prettier when I make them.

Â And so the way that I'm going to to do that is first I'm going to define

Â some set of colors.

Â So here I'm going to call them these tropical colors, this is inspired

Â by the RSkittleBrewer package written by my former student, Alyssa Frazee.

Â And so then what I'm going to do is I'm going to

Â tell R that I want it to use that set of colors.

Â So I can use the palette command to tell R that I would like it to use those colors,

Â look for those colors when its making plots.

Â The other thing that I do is I usually set it up so that the circles are filled in

Â rather than open circles when making plots in R, which is the default.

Â So you can do that with par(pch=19).

Â So the next thing that I'm going to do is I'm going to load in the packages that

Â you need for this example, and so I'm not going to go through all these.

Â Library, I'm not going to type all the commands out, but you need the gplots,

Â devtools, Biobase, RSkittleBrewer, the human org database, and

Â the AnnotationDbi package.

Â So now that I've got all that loaded I'm going to load in the data as well.

Â And so here I go, I'm going to load in the data from a connection.

Â Again, I'm going to make the connection to this

Â URL which you can follow along on the exploratory analogous markdown file.

Â And then once I've done that, I'm going to load the file from the connection.

Â And that's going to take a second, and

Â then I'm going to close the connection because I'll be done with that, oops.

Â And then I look and I see that I've got the body map expression set here.

Â And then to simplify my life, make the variable name a little bit shorter.

Â So I'm going to assign it to this bm variable, and

Â then I'm going to extract out the different pieces that I need.

Â So first I'm going to extract out the phenotype table with pData, and

Â then I'm going to extract out the expression data with the exprs command,

Â and then I'm going to extract out the feature data with the fData command.

Â So now I have these new variables that I've defined that make it a little easier

Â to access the data, that'll make it a little easier to make these files.

Â So the first thing that you want to do is do some really basic checks to

Â make sure everything seems to be in order, and

Â so the first thing that I do is I start to make tables.

Â Particularly I start usually with the phenotype data.

Â So here I'm going to make a table of the gender information

Â from the phenotype table.

Â And I see that there are eight males and eight females, and

Â then I also start to make cross tabs of, so here, I've made a table of gender.

Â And I might want to compare that with the race of the samples.

Â And so you can see here that there's one African American sample

Â that's also a female, so that seems like a little unbalanced.

Â And that's something that I'd start looking for

Â in the phenotype data right away.

Â The other thing I'd do is I'd start looking at the data that I have,

Â the genomic information.

Â If it's a new data type in particular,

Â I want to know what kind of distribution I might expect to see, and so

Â I usually use something like the summary command to do that.

Â So if I type summary(edata), then for every column it's going to show me

Â a summary of the distribution, and so it shows me the quantiles,

Â min, first quartile, median, third quartile, max, and then the mean.

Â And so you can see here already from this data that they're very highly skewed data.

Â The min, first quartile, and median are all 0 and

Â then there's the gigantic max value, so already you can kind of tell that its

Â a skewed distribution and that appears to be true for every sample.

Â So that's already telling me something about what I need to be doing when I need

Â to be modeling.

Â The only thing I do is when I'm making tables,

Â I have to be always reminding myself that the table command,

Â if I do table on age, it looks just fine, it looks like there are no missing values.

Â But if you tell the table command to show NA values, and it actually will,

Â and you can see that there are actually three NA values.

Â So you have to use this useNA parameter to the table function in order to see

Â the NA values.

Â So I do that and then I start to check to see if there are other common missing

Â variable names, or common missing values.

Â And so, for

Â example, I might sum up whether there're any values equal to a blank space.

Â That's a very common missing value indicator in a phenotype table.

Â In this case, you see that the value that you get is NA,

Â that's because there are some NA values in the age variable.

Â And so I can do na.rm=True, so

Â that will remove the NA values when it's doing this sum.

Â And so I can see that there are no values equal to a blank space, so that's good.

Â I'm sort of checking to make sure the common variable,

Â missing names like blank spaces, negative nine, values like that don't appear.

Â Then the other things that I do is I check to see if there are missing values

Â in the genomic data.

Â So if I do is.na on the expression data, it's going to say for

Â every value it's going to check and see if it's missing or not, and

Â return FALSE if it's not missing, and TRUE if it's missing.

Â So is.na is true.

Â So I can just sum up those values over the whole data set, and

Â I can see how many missing values I have for the whole data set.

Â So in this case, there are no missing values in the expression data,

Â that's really good.

Â If there were missing values, you might want to isolate it to which genes and

Â which samples those missing values come from.

Â And so one way that I do that is I use the rowSums command, so again,

Â I can apply rowSums to my check of is there any,

Â so this basically checks to see if each value is NA or not.

Â And then I take the sum of each row, so that's each gene is a row.

Â So it tells me the total per row of missing values and then I can make

Â a table of that and I can see here in this case, 0 is the value for every single row.

Â So there's 52,580 rows, and all of them have 0 NA values.

Â I can also do that for the columns as well, and so

Â basically that's the same thing.

Â I see how many samples have NA by doing callSums(is.na(edata)) there,

Â and so now what this is going to do is check to see if the expression data is NA,

Â and then it's going to take, in each column, the sum and

Â see how many values there are, and I can make the same table here.

Â And see again, there's no missing values.

Â Okay, so then after I do that, the next thing that I do is I check and

Â make sure that the dimensions match in the way that I expect them to.

Â And so then the first thing that I do, is I check to see what's the dimension

Â of the feature data, and then what's the dimension of the phenotype data,

Â and what's the dimension of the expression data?

Â And so remember that the number of rows of the phenotype data should match

Â the number of columns of the genomic data.

Â The number of rows of the feature data should match the number of rows of

Â the expression data, since feature data describes the genes, and

Â phenotype data describes the samples.

Â So once I've satisfied myself that the dimensions match and

Â that there aren't any missing values or that the sort of variable,

Â once I've kind of gone through all the variables and looked at them,

Â the next thing I do is I start plotting, and we'll do that in the next video.

Â Coursera provides universal access to the worldâ€™s best education,
partnering with top universities and organizations to offer courses online.