This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Merge STAR Log.final.out files together

Say I have multiple files like this:

N_1_Log.final.out N_2_Log.final.out N_3_Log.final.out Ni_N1_Log.final.out Ni_N2_Log.final.out Ni_N3_Log.final.out Ni_1_Log.final.out Ni_2_Log.final.out Ni_3_Log.final.out Ni_SM1_Log.final.out Ni_SM2_Log.final.out Ni_SM3_Log.final.out

An example of what the .out file looks like:

                             Started job on |   Apr 23 23:17:02
                         Started mapping on |   Apr 23 23:17:04
                                Finished on |   Apr 23 23:26:52
   Mapping speed, Million of reads per hour |   115.68

                      Number of input reads |   18894432
                  Average input read length |   298
                                UNIQUE READS:
               Uniquely mapped reads number |   17704240
                    Uniquely mapped reads % |   93.70%
                      Average mapped length |   297.39
                   Number of splices: Total |   3119841
        Number of splices: Annotated (sjdb) |   2663436
                   Number of splices: GT/AG |   3080422
                   Number of splices: GC/AG |   14219
                   Number of splices: AT/AC |   248
           Number of splices: Non-canonical |   24952
                  Mismatch rate per base, % |   0.49%
                     Deletion rate per base |   0.02%
                    Deletion average length |   2.70
                    Insertion rate per base |   0.02%
                   Insertion average length |   2.30
                         MULTI-MAPPING READS:
    Number of reads mapped to multiple loci |   806405
         % of reads mapped to multiple loci |   4.27%
    Number of reads mapped to too many loci |   1146
         % of reads mapped to too many loci |   0.01%

I want to make a .csv file where I only take: Number of input reads, Uniquely mapped reads number, and Uniquely mapped reads %. Is there a tool that can do this? Any help would be appreciated.

alignment star compile

3 answers

MultiQC understands STAR logs (see extension notes here). After running MultiQC, there's a json object which you can parse of the accumulated reports if that's more in line with what you have in mind.

STAR comes with a script that merges Log.final.out files from multiple runs into one table

You can also do something like this:

tail -n +1 -- *.Log.final.out > "all.Log.final.out"

Log in to answer this question.