Answers.Body: <p>I don't expect the soft or matrix files will be useful for you, although it might be possible to pull metadata out of those files if absolutely necessary. I usually only see those for microarray data, so it might be worth double-checking that you do actually have RNASeq data.</p>
  <p>I've found the best &quot;quick start&quot; explanation on how to carry out differential expression analysis to be the one for <a href="https://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#quick-start" rel="nofollow noreferrer">DESeq2</a>. As input, this requires three things:</p>
  <ol>
  <li>A count matrix, with samples in columns, genes in rows, and matrix entries being the raw read counts of reads mapped to genes for each sample</li>
  <li>A metadata data frame, with rows arranged exactly as in the columns of the count matrix, and fields describing features of each sample</li>
  <li>A statistical model / equation that describes the relationship between samples</li>
  </ol>
  <p>I have found the equation to be the most complicated to understand, and unfortunately it's very situation dependent. In its simplest form, setting up a DESeq2 data structure would look like this:</p>
  <pre><code>dds &lt;- DESeqDataSetFromMatrix(countData = count.mat,
                                colData = metadata.df,
                                design= ~ Condition)
  </code></pre>
  <p>This would be for a situation where all samples were sequenced in the same sequencing run, and only a single characteristic were being compared (e.g. with vs without treatment). The metadata data frame might look something like this:</p>
  <pre><code>metadata.df &lt;- data.frame(row.names = colnames(count.mat),
                            Condition = c(rep(&quot;treated&quot;, 6),
                                          rep(&quot;untreated&quot;, 6))
  </code></pre>
  <p>e.g.:</p>
  <pre><code>          Condition
  Sample01    treated
  Sample02    treated
  Sample03    treated
  Sample04    treated
  Sample05    treated
  Sample06    treated
  Sample07  untreated
  Sample08  untreated
  Sample09  untreated
  Sample010 untreated
  Sample011 untreated
  Sample012 untreated
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-22T00:00:30.387Z
Answers.LastActivityDate: 2022-01-22T00:00:30.387Z
Answers.UserDisplayName: gringer
Answers.Body: <p>A metadata file isn't that large or complicated.  If you want to do DE, you must have two treatments?  Or two timepoints?  Two or more something, and you are comparing samples of one type to another?</p>
  <p>It's just a data table where the rownames are the samples, and then a column for, say, treatment.  If you have some samples treated, some not, some at day 0, and some at day 5, then you have a column for Day and another column for Treatment.  (Depending on what you want to compare to what, you might want another column of Day_Treatment)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-20T20:06:08.093Z
Answers.LastActivityDate: 2022-01-20T20:06:08.093Z
Answers.UserDisplayName: swbarnes2
Body: <p>So, I have downloaded some .txt and .csv files containing the raw count data (I am supposed to find out differentially expressed genes and see which genes and up- and down-regulated). I have also downloaded both the .family.soft and the series matrix files as they mentioned they contained metadata - however I'm facing several errors while trying to import them.</p>
  <p>And all the tutorials I am trying to follow seem to have premade metadata files and there is no explanation on how this metadata is made.</p>
  <p>Please help me in trying to understand what I am doing wrong and how to proceed. I will try to give as much information as I can to the best of my abilities, as I have barely any experience in this field.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-01-20T15:31:09.177Z
Comments.Text: You may want to add to the post the first ten lines (and if the files are delimited with >10 columns, restrict to just the first 10 columns as well) of each file so people here can see what these files contain.
Comments.UserDisplayName: Ram RS
Tags: <r><rna-seq><deseq2>
Title: How to input data and metadata from NCBI for RNA-Seq analysis in R
ThreadText: # How to input data and metadata from NCBI for RNA-Seq analysis in R
  
  (Asked by: username_0 on 2022-01-20)
  
  So, I have downloaded some .txt and .csv files containing the raw count data (I am supposed to find out differentially expressed genes and see which genes and up- and down-regulated). I have also downloaded both the .family.soft and the series matrix files as they mentioned they contained metadata - however I'm facing several errors while trying to import them.
  
  And all the tutorials I am trying to follow seem to have premade metadata files and there is no explanation on how this metadata is made.
  
  Please help me in trying to understand what I am doing wrong and how to proceed. I will try to give as much information as I can to the best of my abilities, as I have barely any experience in this field.
  
  **Tags:** r, rna-seq, deseq2
  
  > **Comments:**
  > **username_1**: You may want to add to the post the first ten lines (and if the files are delimited with >10 columns, restrict to just the first 10 columns as well) of each file so people here can see what these files contain.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2022-01-22. Score: 1
  
  I don't expect the soft or matrix files will be useful for you, although it might be possible to pull metadata out of those files if absolutely necessary. I usually only see those for microarray data, so it might be worth double-checking that you do actually have RNASeq data.
  
  I've found the best "quick start" explanation on how to carry out differential expression analysis to be the one for [DESeq2](https://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#quick-start). As input, this requires three things:
  
  1. A count matrix, with samples in columns, genes in rows, and matrix entries being the raw read counts of reads mapped to genes for each sample
  2. A metadata data frame, with rows arranged exactly as in the columns of the count matrix, and fields describing features of each sample
  3. A statistical model / equation that describes the relationship between samples
  
  I have found the equation to be the most complicated to understand, and unfortunately it's very situation dependent. In its simplest form, setting up a DESeq2 data structure would look like this:
  
  ```
  dds <- DESeqDataSetFromMatrix(countData = count.mat,
                                colData = metadata.df,
                                design= ~ Condition)
  
  ```
  
  This would be for a situation where all samples were sequenced in the same sequencing run, and only a single characteristic were being compared (e.g. with vs without treatment). The metadata data frame might look something like this:
  
  ```
  metadata.df <- data.frame(row.names = colnames(count.mat),
                            Condition = c(rep("treated", 6),
                                          rep("untreated", 6))
  
  ```
  
  e.g.:
  
  ```
            Condition
  Sample01    treated
  Sample02    treated
  Sample03    treated
  Sample04    treated
  Sample05    treated
  Sample06    treated
  Sample07  untreated
  Sample08  untreated
  Sample09  untreated
  Sample010 untreated
  Sample011 untreated
  Sample012 untreated
  
  ```
  
  
  ---
  
  ### Answer by username_3 on 2022-01-20. Score: 1
  
  A metadata file isn't that large or complicated. If you want to do DE, you must have two treatments? Or two timepoints? Two or more something, and you are comparing samples of one type to another?
  
  It's just a data table where the rownames are the samples, and then a column for, say, treatment. If you have some samples treated, some not, some at day 0, and some at day 5, then you have a column for Day and another column for Treatment. (Depending on what you want to compare to what, you might want another column of Day\_Treatment)
  
  
  ---
  
  