转录组分析实战第三节: RESM对Trinity得到的转录本进行定量

前面三节,我们得到了Trinity拼接的Fasta 文件(Trinity.fasta)以及通过Bowtie2将Fastq中的Reads进行回贴到Trinity.fasta文件的sam文件。

接下来的两节中我们将采RESM(依赖于比对的定量工具)以及Salmon(不依赖于定量的工具)进行Trinity中的转录本丰度定量。

我们采用的是Trinity自带的脚本进行定量计算。以前的版本可调用bowtie2比对好的bam文件,但是现在这个版本似乎不行了。所以我们只有重新做一次bowtie2比对。

yeyt@ubuntu:~/biodata/NH160034/NH160034/cleandata/assembly$ l
B251_1.P.fq.gz  R251_1.P.fq.gz  RESMest.sh    W251_1.P.fq.gz  samples.txt
B251_2.P.fq.gz  R251_2.P.fq.gz  RSEMout/      W251_2.P.fq.gz  trinitassembly.sh
B252_1.P.fq.gz  R252_1.P.fq.gz  Salmonest.sh  W252_1.P.fq.gz  trinity_out_dir/
B252_2.P.fq.gz  R252_2.P.fq.gz  Salmonout/    W252_2.P.fq.gz
#在这个文件夹中有包括cleandata数据、样品信息(sample.txt)
yeyt@ubuntu:~/biodata/NH160034/NH160034/cleandata/assembly$ cat RESMest.sh 
$TRINITY_HOME/util/align_and_estimate_abundance.pl --transcripts /home/yeyt/biodata/NH160034/NH160034/cleandata/assembly/trinity_out_dir/Trinity.fasta --seqType fq --samples_file /home/yeyt/biodata/NH160034/NH160034/cleandata/assembly/samples.txt --est_method RSEM --aln_method bowtie2 --trinity_mode --prep_reference  --output_dir RSEMResult --thread_count 12 
脚本运行就好了,但是时间很长我们就不用等了,最后会形成6个文件夹。需要讲解的是脚本中的参数
$TRINITY_HOME/util/align_and_estimate_abundance.pl  \ #指明调用的脚本
--transcripts /home/yeyt/biodata/NH160034/NH160034/cleandata/assembly/trinity_out_dir/Trinity.fasta \ #读取之前Trinity拼接的转录本
--seqType fq \ #读取的原始数据的数据类型是fastq
--samples_file /home/yeyt/biodata/NH160034/NH160034/cleandata/assembly/samples.txt \ #读取样品信息
--est_method RSEM \ #进行表达量计算的软件是RSEM
--aln_method bowtie2 \ #由于RSEM是通过比对进行的表达量计算,因此会采用的bowtie2进行比对
--trinity_mode \ #这个加上会采用Trinitymode以调用前期assembly过程中的一个gene_trans_map文件
--prep_reference  \ #会根据拼接的fasta文件构建index
--output_dir RSEMResult \#输出文件夹,但这个由于会采用读取样品信息,因此会输入到样品信息的文件夹
--thread_count 12 #这个选项控制系统耗用的CPU线程数
大概每个样品的运算时间是6h最后结果手动整理放到了RSEMout这个文件夹中
yeyt@ubuntu:~/biodata/NH160034/NH160034/cleandata/assembly/RSEMout$ tree .
.
├── B251
│   ├── bowtie2.bam
│   ├── bowtie2.bam.for_rsem.bam
│   ├── bowtie2.bam.ok
│   ├── RSEM.genes.results
│   ├── RSEM.isoforms.results
│   ├── RSEM.isoforms.results.ok
│   └── RSEM.stat
│       ├── RSEM.cnt
│       ├── RSEM.model
│       └── RSEM.theta
├── B252
│   ├── bowtie2.bam
│   ├── bowtie2.bam.for_rsem.bam
│   ├── bowtie2.bam.ok
│   ├── RSEM.genes.results
│   ├── RSEM.isoforms.results
│   ├── RSEM.isoforms.results.ok
│   └── RSEM.stat
│       ├── RSEM.cnt
│       ├── RSEM.model
│       └── RSEM.theta
├── quant.file
├── R251
│   ├── bowtie2.bam
│   ├── bowtie2.bam.for_rsem.bam
│   ├── bowtie2.bam.ok
│   ├── RSEM.genes.results
│   ├── RSEM.isoforms.results
│   ├── RSEM.isoforms.results.ok
│   └── RSEM.stat
│       ├── RSEM.cnt
│       ├── RSEM.model
│       └── RSEM.theta
├── R252
│   ├── bowtie2.bam
│   ├── bowtie2.bam.for_rsem.bam
│   ├── bowtie2.bam.ok
│   ├── RSEM.genes.results
│   ├── RSEM.isoforms.results
│   ├── RSEM.isoforms.results.ok
│   └── RSEM.stat
│       ├── RSEM.cnt
│       ├── RSEM.model
│       └── RSEM.theta
├── RSEM.gene.counts.matrix
├── RSEM.gene.TMM.EXPR.matrix
├── RSEM.gene.TPM.not_cross_norm
├── RSEM.gene.TPM.not_cross_norm.runTMM.R
├── RSEM.gene.TPM.not_cross_norm.TMM_info.txt
├── RSEM.isoform.counts.matrix
├── RSEM.isoform.TMM.EXPR.matrix
├── RSEM.isoform.TPM.not_cross_norm
├── RSEM.isoform.TPM.not_cross_norm.runTMM.R
├── RSEM.isoform.TPM.not_cross_norm.TMM_info.txt
├── RSEMmatrix.sh
├── W251
│   ├── bowtie2.bam
│   ├── bowtie2.bam.for_rsem.bam
│   ├── bowtie2.bam.ok
│   ├── RSEM.genes.results
│   ├── RSEM.isoforms.results
│   ├── RSEM.isoforms.results.ok
│   └── RSEM.stat
│       ├── RSEM.cnt
│       ├── RSEM.model
│       └── RSEM.theta
└── W252
    ├── bowtie2.bam
    ├── bowtie2.bam.for_rsem.bam
    ├── bowtie2.bam.ok
    ├── RSEM.genes.results
    ├── RSEM.isoforms.results
    ├── RSEM.isoforms.results.ok
    └── RSEM.stat
        ├── RSEM.cnt
        ├── RSEM.model
        └── RSEM.theta

12 directories, 66 files
这个文件夹中可以看到,很多bam文件,这些文件都是bowtie2产生的,并且会形成基于基因的EM Reads Counts 和基于转录本的EM Reads Counts
yeyt@ubuntu:~/biodata/NH160034/NH160034/cleandata/assembly/RSEMout$ tree B251
B251
├── bowtie2.bam #bowtie2 生成的 bam文件
├── bowtie2.bam.for_rsem.bam #用于RSEM计算的 bam文件
├── bowtie2.bam.ok
├── RSEM.genes.results #基于基因的EM Reads Count
├── RSEM.isoforms.results #基于转录本的 EM Reads Count
├── RSEM.isoforms.results.ok
└── RSEM.stat
    ├── RSEM.cnt
    ├── RSEM.model
    └── RSEM.theta

1 directory, 9 files
后期主要会使用的是两个results文件
由于我们在每一个文件夹中的Reads count 没有经样本间的均一化,因此需要做一个样本均一化,构建转录本-基因表达矩阵并得到不同样本中的均一化表达数据TMM是后期要做的一个工作。我们采用以下的矩阵的到了三个结果
yeyt@ubuntu:~/biodata/NH160034/NH160034/cleandata/assembly/RSEMout$ find * -name '*.isoforms.results'> quant.file 
#这个地方,我们采用了find命令将子文件夹中的isoform基因表达量结果全部查找出来然后路径放到一个文件中(quant.file)后期要使用
yeyt@ubuntu:~/biodata/NH160034/NH160034/cleandata/assembly/RSEMout$ cat quant.file 
B251/RSEM.isoforms.results
B252/RSEM.isoforms.results
R251/RSEM.isoforms.results
R252/RSEM.isoforms.results
W251/RSEM.isoforms.results
W252/RSEM.isoforms.results
yeyt@ubuntu:~/biodata/NH160034/NH160034/cleandata/assembly/RSEMout$ cat RSEMmatrix.sh 
$TRINITY_HOME/util/abundance_estimates_to_matrix.pl --est_method RSEM --gene_trans_map ../trinity_out_dir/Trinity.fasta.gene_trans_map --name_sample_by_basedir --quant_files quant.file
在此需要注释一下这个sh脚本
$TRINITY_HOME/util/abundance_estimates_to_matrix.pl  \ #采用的脚本
--est_method RSEM \ #由于是对RSEM的结果进行矩阵构建,因此需要说明这个
--gene_trans_map ../trinity_out_dir/Trinity.fasta.gene_trans_map \ #通过这个map构建基因的表达量矩阵
--name_sample_by_basedir \ #这个必须要选,不然会导致程序没办法合并之前的结果进行计算
--quant_files quant.file \ #这个指明需要的上游文件的位置

经过计算后得到的结果如下:

yeyt@ubuntu:~/biodata/NH160034/NH160034/cleandata/assembly/RSEMout$ ll | sort -nk 7
total 53172
drwxrwxr-x 3 yeyt yeyt    12288 Sep 25 02:06 B251/
drwxrwxr-x 3 yeyt yeyt    12288 Sep 25 07:39 B252/
drwxrwxr-x 3 yeyt yeyt    12288 Sep 25 13:25 R251/
drwxrwxr-x 3 yeyt yeyt    12288 Sep 25 19:01 R252/
-rw-rw-r-- 1 yeyt yeyt      185 Sep 26 14:23 RSEMmatrix.sh
-rw-rw-r-- 1 yeyt yeyt      318 Sep 26 14:24 RSEM.isoform.TPM.not_cross_norm.TMM_info.txt
-rw-rw-r-- 1 yeyt yeyt      318 Sep 26 14:25 RSEM.gene.TPM.not_cross_norm.TMM_info.txt
-rw-rw-r-- 1 yeyt yeyt      518 Sep 26 14:24 RSEM.gene.TPM.not_cross_norm.runTMM.R
-rw-rw-r-- 1 yeyt yeyt      524 Sep 26 14:24 RSEM.isoform.TPM.not_cross_norm.runTMM.R
-rw-rw-r-- 1 yeyt yeyt  5013571 Sep 26 14:24 RSEM.gene.TPM.not_cross_norm
-rw-rw-r-- 1 yeyt yeyt  6145228 Sep 26 14:24 RSEM.gene.counts.matrix
-rw-rw-r-- 1 yeyt yeyt  6487281 Sep 26 14:25 RSEM.gene.TMM.EXPR.matrix
-rw-rw-r-- 1 yeyt yeyt 10591810 Sep 26 14:24 RSEM.isoform.TPM.not_cross_norm
-rw-rw-r-- 1 yeyt yeyt 12620783 Sep 26 14:24 RSEM.isoform.counts.matrix
-rw-rw-r-- 1 yeyt yeyt 13469797 Sep 26 14:24 RSEM.isoform.TMM.EXPR.matrix
drwxrwxr-x 3 yeyt yeyt    12288 Sep 26 01:01 W251/
drwxrwxr-x 3 yeyt yeyt    12288 Sep 26 06:52 W252/
drwxrwxr-x 5 yeyt yeyt     4096 Sep 26 13:07 ../
drwxrwxr-x 8 yeyt yeyt     4096 Sep 26 14:25 ./
-rw-rw-r-- 1 yeyt yeyt      162 Sep 28 00:52 quant.file

以上结果中分为基因的表达矩阵和转录本的表达矩阵。

1. '.counts.matrix' 文件用于后期的差异表达分析
2. '.TMM.EXPR.matrix'文件可以用于其他基因表达的分析

另外一个软件Salmon的使用的脚本是

首先还是先及进行表达量的分析(这个软件就很快了)
yeyt@ubuntu:~/biodata/NH160034/NH160034/cleandata/assembly$ cat Salmonest.sh 
$TRINITY_HOME/util/align_and_estimate_abundance.pl \
--transcripts /home/yeyt/biodata/NH160034/NH160034/cleandata/assembly/trinity_out_dir/Trinity.fasta \
--seqType fq \
--samples_file /home/yeyt/biodata/NH160034/NH160034/cleandata/assembly/samples.txt \
--est_method salmon \ #和前面的RSEM方式不同的 就是在于不用指定是使用bowtie2来进行
--trinity_mode \
--prep_reference \
 --output_dir RSEMResult \
--thread_count 12 \
运行后的得到的结果是这样的 :
yeyt@ubuntu:~/biodata/NH160034/NH160034/cleandata/assembly/Salmonout$ ll
total 59900
drwxrwxr-x 8 yeyt yeyt     4096 Sep 26 14:16 ./
drwxrwxr-x 5 yeyt yeyt     4096 Sep 26 13:07 ../
drwxrwxr-x 5 yeyt yeyt     4096 Sep 26 13:06 B251/
drwxrwxr-x 5 yeyt yeyt     4096 Sep 26 13:07 B252/
drwxrwxr-x 5 yeyt yeyt     4096 Sep 26 13:06 R251/
drwxrwxr-x 5 yeyt yeyt     4096 Sep 26 13:07 R252/
drwxrwxr-x 5 yeyt yeyt     4096 Sep 26 13:06 W251/
drwxrwxr-x 5 yeyt yeyt     4096 Sep 26 13:07 W252/
-rw-rw-r-- 1 yeyt yeyt       84 Sep 26 14:08 quant.file
-rw-rw-r-- 1 yeyt yeyt  6496600 Sep 26 14:16 salmon.gene.TMM.EXPR.matrix
-rw-rw-r-- 1 yeyt yeyt  7018952 Sep 26 14:16 salmon.gene.TPM.not_cross_norm
-rw-rw-r-- 1 yeyt yeyt      319 Sep 26 14:16 salmon.gene.TPM.not_cross_norm.TMM_info.txt
-rw-rw-r-- 1 yeyt yeyt      522 Sep 26 14:16 salmon.gene.TPM.not_cross_norm.runTMM.R
-rw-rw-r-- 1 yeyt yeyt  6224935 Sep 26 14:16 salmon.gene.counts.matrix
-rw-rw-r-- 1 yeyt yeyt 13486392 Sep 26 14:16 salmon.isoform.TMM.EXPR.matrix
-rw-rw-r-- 1 yeyt yeyt 14102405 Sep 26 14:16 salmon.isoform.TPM.not_cross_norm
-rw-rw-r-- 1 yeyt yeyt      318 Sep 26 14:16 salmon.isoform.TPM.not_cross_norm.TMM_info.txt
-rw-rw-r-- 1 yeyt yeyt      528 Sep 26 14:16 salmon.isoform.TPM.not_cross_norm.runTMM.R
-rw-rw-r-- 1 yeyt yeyt 13941136 Sep 26 14:16 salmon.isoform.counts.matrix
-rw-rw-r-- 1 yeyt yeyt      211 Sep 26 14:16 salmonmatrix.sh
同样的,对基因表达的矩阵进行计算后的得到了后面那几个文件,再次不再赘述仅仅将相关的脚本放出来
yeyt@ubuntu:~/biodata/NH160034/NH160034/cleandata/assembly/Salmonout$ cat salmonmatrix.sh 
/home/yeyt/biosoft/trinityrnaseq-Trinity-v2.8.3/util/abundance_estimates_to_matrix.pl --est_method salmon --gene ../trinity_out_dir/Trinity.fasta.gene_trans_map --name_sample_by_basedir --quant_files quant.file
接下来,我们要基于表达量对我们的得到的拼接序列进行一个过滤
首先先基于表达量看看我们的转录本的表达量分布情况
yeyuntian@yeyuntian-rescuer-r720-15ikbn:~/trinitytest/downstr/RSEMout/RSEMout$ $TRINITY_HOME/util/misc/count_matrix_features_given_MIN_TPM_threshold.pl RSEM.gene.TPM.not_cross_norm | tee RSEM.gene.TPM.not_cross_norm.counts_by_min_TPM 
neg_min_tpm num_features
-27426  1
-26974  2
-14158  3
-13685  4
-13426  5
-10404  6
-10066  7
-9661   8
-9439   9
-8546   10
-8136   11
-7799   12
-6143   13
-5960   14
-5932   15
-5657   16
-5293   17
-4380   18
-3937   19
-3734   20
-3654   21
-3614   22
-3611   23
-3541   24
-3502   25
-3472   27
-3400   28
-3365   29
-3215   30
-3152   31
-2941   32
-2921   33
-2827   34
-2725   35
-2671   36
-2665   37
-2554   38
-2504   39
-2495   40
-2461   41
-2458   42
-2453   43
-2446   44
-2415   45
-2382   46
-2381   47
-2327   48
-2210   49
-2164   50
-2108   51
-2099   52
-2093   53
-2050   54
-2006   55
-2000   56
-1967   57
-1955   58
-1950   59
-1930   60
-1926   61
-1905   62
-1904   63
-1879   64
-1872   65
-1856   66
-1845   67
-1788   68
-1770   69
-1741   70
-1739   71
-1738   72
-1688   73
-1677   74
-1665   75
-1657   76
-1651   77
-1646   78
-1643   79
-1629   80
-1628   81
-1607   82
-1596   83
-1559   84
-1555   85
-1528   86
-1527   87
-1516   88
-1492   89
-1491   90
-1486   91
-1471   92
-1470   93
-1460   94
-1452   95
-1436   96
-1429   97
-1410   98
-1406   99
-1378   100
-1375   101
-1360   102
-1357   103
-1356   104
-1344   105
-1331   106
-1325   107
-1294   108
-1252   109
-1251   110
-1231   111
-1224   112
-1222   113
-1216   114
-1201   115
-1165   116
-1158   117
-1130   118
-1128   119
-1118   120
-1110   121
-1105   122
-1101   123
-1095   124
-1090   125
-1083   126
-1082   127
-1069   128
-1068   129
-1061   130
-1059   131
-1058   132
-1053   133
-1051   134
-1046   135
-1044   136
-1041   137
-1035   138
-1028   139
-1007   140
-1006   141
-1000   142
-999    143
-992    144
-990    145
-989    146
-976    147
-966    149
-960    150
-950    151
-948    152
-940    153
-934    154
-923    156
-922    158
-921    159
-919    160
-906    161
-905    162
-896    163
-893    164
-886    165
-882    166
-881    167
-876    168
-874    169
-870    170
-865    171
-863    173
-862    174
-849    175
-847    176
-841    178
-833    179
-824    180
-822    181
-813    182
-808    183
-807    184
-806    185
-802    186
-800    187
-793    188
-788    190
-787    191
-783    193
-779    194
-777    195
-776    196
-773    197
-762    198
-756    199
-745    200
-742    201
-741    202
-739    203
-735    204
-732    205
-731    206
-726    207
-724    208
-722    210
-719    211
-717    215
-715    216
-714    217
-713    218
-706    219
-703    221
-697    223
-696    224
-690    225
-689    226
-685    227
-684    228
-683    229
-682    230
-680    231
-675    232
-673    233
-671    234
-670    235
-669    236
-668    237
-667    239
-666    240
-665    241
-664    243
-661    244
-650    246
-648    247
-646    248
-642    250
-641    251
-634    252
-633    254
-632    256
-626    257
-625    258
-618    259
-616    261
-614    262
-613    263
-612    265
-610    266
-609    267
-608    268
-607    272
-602    273
-601    275
-600    276
-598    277
-597    280
-596    283
-594    284
-587    285
-585    287
-583    289
-581    291
-580    292
-579    293
-577    294
-576    295
-572    297
-571    298
-566    299
-564    301
-556    303
-553    304
-551    306
-550    308
-545    309
-544    312
-543    314
-540    316
-539    317
-538    318
-537    320
-536    322
-535    323
-534    324
-531    326
-530    328
-527    329
-525    331
-523    332
-521    333
-519    336
-518    337
-517    338
-516    340
-515    341
-514    343
-513    344
-511    347
-510    348
-509    349
-508    351
-506    353
-503    355
-502    356
-501    357
-494    358
-492    360
-489    361
-487    362
-486    363
-485    364
-484    365
-483    366
-482    367
-481    368
-478    370
-477    372
-476    375
-475    379
-469    380
-468    382
-466    384
-464    385
-463    387
-462    388
-461    389
-460    390
-459    393
-456    395
-455    396
-451    397
-450    398
-448    401
-447    403
-446    405
-445    406
-444    407
-443    409
-442    414
-441    415
-440    416
-439    417
-437    419
-436    420
-435    421
-432    422
-431    423
-430    425
-429    426
-428    427
-427    428
-426    429
-425    430
-423    435
-422    438
-421    439
-420    440
-419    442
-417    443
-416    444
-413    446
-412    448
-411    449
-406    452
-405    454
-404    456
-403    458
-402    460
-401    461
-400    462
-398    465
-397    468
-394    472
-393    473
-392    475
-391    476
-389    478
-388    480
-386    481
-382    483
-381    485
-379    488
-378    489
-377    490
-376    491
-375    492
-374    494
-373    496
-370    498
-369    500
-368    501
-367    502
-366    503
-364    505
-363    506
-361    507
-360    510
-359    513
-358    516
-356    517
-354    520
-353    524
-352    527
-351    529
-350    530
-349    531
-348    534
-347    536
-344    537
-343    542
-342    543
-340    545
-339    547
-338    550
-337    551
-336    553
-335    555
-334    557
-332    559
-331    561
-330    563
-329    565
-328    568
-327    569
-326    571
-325    572
-324    573
-323    575
-322    576
-321    580
-320    583
-319    587
-318    590
-317    594
-316    596
-315    601
-314    602
-313    605
-312    609
-311    611
-310    613
-309    615
-308    619
-307    621
-305    624
-304    625
-303    630
-302    635
-301    637
-298    638
-297    640
-296    643
-294    646
-292    647
-291    648
-290    650
-289    655
-288    656
-287    657
-286    659
-285    663
-284    665
-283    667
-282    669
-281    670
-279    673
-278    674
-277    675
-276    676
-274    680
-273    682
-272    684
-271    685
-270    687
-269    692
-268    693
-267    696
-266    698
-265    703
-264    705
-263    706
-262    708
-261    712
-260    714
-259    716
-258    718
-257    721
-256    722
-255    725
-253    730
-252    733
-251    735
-250    737
-249    745
-248    749
-247    751
-246    757
-245    759
-244    761
-243    766
-242    770
-241    772
-240    775
-239    778
-238    784
-237    786
-236    789
-235    793
-234    795
-233    799
-232    801
-231    809
-230    812
-229    815
-227    819
-226    822
-225    824
-224    827
-223    828
-222    831
-221    834
-220    838
-219    845
-218    850
-217    860
-216    861
-215    867
-214    874
-213    879
-212    883
-211    890
-210    893
-209    900
-208    902
-207    906
-206    915
-205    922
-204    926
-203    930
-202    939
-201    946
-200    951
-199    955
-198    963
-197    975
-196    979
-195    985
-194    989
-193    996
-192    1002
-191    1009
-190    1011
-189    1017
-188    1023
-187    1032
-186    1036
-185    1045
-184    1051
-183    1057
-182    1062
-181    1068
-180    1080
-179    1089
-178    1097
-177    1106
-176    1108
-175    1111
-174    1118
-173    1122
-172    1130
-171    1135
-170    1139
-169    1147
-168    1155
-167    1162
-166    1171
-165    1177
-164    1190
-163    1199
-162    1207
-161    1219
-160    1231
-159    1235
-158    1240
-157    1251
-156    1259
-155    1262
-154    1269
-153    1278
-152    1283
-151    1292
-150    1303
-149    1312
-148    1322
-147    1329
-146    1338
-145    1346
-144    1356
-143    1363
-142    1370
-141    1376
-140    1390
-139    1399
-138    1417
-137    1431
-136    1435
-135    1444
-134    1450
-133    1463
-132    1475
-131    1486
-130    1502
-129    1513
-128    1522
-127    1537
-126    1552
-125    1569
-124    1578
-123    1596
-122    1607
-121    1620
-120    1642
-119    1651
-118    1665
-117    1679
-116    1697
-115    1715
-114    1734
-113    1749
-112    1768
-111    1778
-110    1795
-109    1810
-108    1824
-107    1836
-106    1853
-105    1869
-104    1887
-103    1911
-102    1934
-101    1954
-100    1973
-99 1993
-98 2011
-97 2037
-96 2066
-95 2081
-94 2096
-93 2117
-92 2147
-91 2160
-90 2189
-89 2212
-88 2234
-87 2250
-86 2272
-85 2288
-84 2325
-83 2351
-82 2389
-81 2414
-80 2442
-79 2472
-78 2499
-77 2533
-76 2570
-75 2607
-74 2635
-73 2669
-72 2694
-71 2721
-70 2764
-69 2801
-68 2847
-67 2883
-66 2920
-65 2951
-64 2987
-63 3043
-62 3089
-61 3140
-60 3193
-59 3242
-58 3301
-57 3357
-56 3416
-55 3465
-54 3526
-53 3586
-52 3662
-51 3738
-50 3803
-49 3869
-48 3937
-47 4017
-46 4097
-45 4174
-44 4265
-43 4354
-42 4444
-41 4528
-40 4633
-39 4720
-38 4839
-37 4964
-36 5097
-35 5227
-34 5366
-33 5501
-32 5661
-31 5827
-30 6002
-29 6166
-28 6349
-27 6550
-26 6737
-25 6960
-24 7188
-23 7402
-22 7668
-21 7936
-20 8207
-19 8519
-18 8853
-17 9223
-16 9606
-15 10071
-14 10494
-13 11018
-12 11582
-11 12174
-10 12908
-9  13802
-8  14803
-7  16084
-6  17885
-5  20261
-4  23909
-3  29828
-2  40194
-1  62919
0   110851
#这个是按照基因表达量进行的排序
yeyuntian@yeyuntian-rescuer-r720-15ikbn:~/trinitytest/downstr/RSEMout/RSEMout$ $TRINITY_HOME/util/misc/count_matrix_features_given_MIN_TPM_threshold.pl RSEM.isoform.TPM.not_cross_norm | tee RSEM.isoform.TPM.not_cross_norm.counts_by_min_TPM 
neg_min_tpm num_features
-26984  1
-26974  2
-13426  3
-9538   4
-9439   5
-8546   6
-7799   7
-7797   8
-7304   9
-5932   10
-5414   11
-5104   12
-4758   13
-4020   14
-3811   15
-3740   16
-3647   17
-3611   18
-3400   19
-3304   20
-3294   21
-2863   22
-2725   23
-2586   24
-2580   25
-2554   26
-2502   27
-2486   28
-2426   29
-2386   30
-2381   31
-2327   32
-2297   33
-2286   34
-2220   35
-2174   36
-2057   37
-1967   38
-1895   39
-1872   40
-1862   41
-1806   42
-1779   43
-1758   44
-1740   45
-1738   46
-1723   47
-1701   48
-1686   49
-1683   50
-1666   51
-1665   52
-1654   53
-1648   54
-1633   55
-1620   56
-1605   57
-1601   58
-1586   59
-1582   61
-1559   62
-1537   63
-1519   64
-1483   65
-1470   66
-1467   67
-1452   68
-1445   69
-1444   70
-1440   71
-1428   72
-1412   73
-1406   74
-1400   75
-1378   76
-1375   77
-1370   78
-1350   79
-1298   80
-1287   81
-1258   82
-1252   83
-1232   84
-1228   85
-1224   86
-1218   87
-1201   88
-1197   89
-1185   90
-1172   91
-1165   92
-1145   93
-1143   94
-1136   95
-1127   96
-1107   97
-1100   98
-1098   100
-1095   101
-1091   102
-1061   103
-1059   104
-1043   105
-1041   106
-1034   107
-1023   108
-1009   109
-996    110
-995    111
-989    112
-986    113
-974    115
-962    116
-956    117
-934    118
-923    119
-921    120
-920    121
-917    123
-915    124
-913    125
-901    126
-898    127
-876    128
-873    129
-869    130
-865    131
-862    132
-852    133
-847    134
-833    135
-821    136
-816    137
-814    138
-813    139
-791    140
-788    141
-782    143
-779    145
-773    148
-767    149
-762    150
-758    151
-754    152
-750    153
-747    154
-744    155
-742    156
-740    157
-739    158
-738    159
-735    161
-732    162
-731    163
-726    164
-722    165
-717    167
-712    168
-710    169
-708    170
-706    171
-705    172
-702    173
-697    175
-690    176
-688    177
-685    178
-682    179
-680    181
-678    182
-677    183
-674    184
-667    185
-660    187
-659    188
-655    189
-648    191
-644    192
-642    193
-641    194
-636    195
-635    197
-634    198
-633    199
-630    200
-628    201
-627    202
-626    203
-618    205
-612    206
-606    207
-603    209
-602    210
-601    211
-600    213
-598    214
-597    218
-594    221
-593    222
-589    223
-588    224
-587    226
-586    228
-584    229
-583    231
-582    232
-581    233
-576    234
-572    236
-570    237
-566    238
-561    239
-558    240
-556    242
-555    243
-553    244
-552    247
-546    248
-544    250
-542    251
-541    252
-540    253
-539    254
-537    256
-536    257
-532    258
-530    259
-527    260
-525    261
-524    262
-523    263
-520    266
-519    267
-517    268
-516    269
-515    270
-514    271
-511    272
-510    273
-509    274
-508    275
-506    276
-505    277
-503    278
-500    279
-498    280
-494    281
-492    283
-489    284
-487    286
-485    287
-479    288
-476    290
-475    291
-474    292
-472    294
-471    295
-464    296
-462    297
-459    299
-458    300
-457    302
-452    303
-450    304
-448    305
-447    307
-446    309
-445    310
-444    312
-443    313
-441    315
-440    316
-439    318
-438    319
-437    320
-436    322
-435    324
-434    325
-432    326
-431    328
-430    329
-428    330
-426    332
-425    333
-424    335
-423    336
-422    337
-420    339
-419    340
-418    341
-415    344
-414    346
-412    348
-411    350
-406    352
-405    354
-403    357
-401    359
-399    362
-398    365
-397    366
-396    370
-394    371
-393    372
-392    373
-391    374
-390    375
-389    377
-388    378
-387    380
-386    382
-385    383
-384    384
-382    385
-381    386
-380    389
-378    390
-376    391
-375    394
-374    396
-371    398
-369    399
-368    401
-367    402
-364    404
-363    407
-362    408
-360    409
-359    411
-358    413
-357    414
-355    416
-354    417
-353    420
-352    423
-351    425
-350    426
-347    427
-346    429
-345    435
-344    437
-343    438
-342    440
-339    441
-338    442
-337    444
-336    445
-335    448
-334    450
-333    452
-332    453
-331    455
-330    459
-329    461
-328    462
-327    465
-325    467
-324    468
-323    472
-322    474
-321    479
-320    480
-319    482
-318    485
-317    487
-316    491
-315    492
-314    494
-313    495
-312    497
-311    499
-310    502
-309    504
-308    506
-307    509
-305    512
-304    516
-302    517
-300    519
-299    521
-297    525
-296    528
-295    530
-294    533
-293    536
-292    537
-291    538
-290    542
-289    543
-288    544
-286    546
-285    549
-284    553
-283    554
-282    558
-281    560
-279    561
-278    562
-277    566
-276    567
-275    571
-274    575
-273    580
-272    583
-270    587
-269    590
-268    594
-267    599
-266    603
-265    607
-264    609
-263    611
-262    613
-261    622
-260    623
-259    627
-258    633
-257    635
-256    638
-255    639
-254    642
-253    647
-252    648
-251    652
-250    653
-249    657
-248    661
-247    667
-246    669
-245    671
-244    675
-243    678
-242    681
-241    684
-240    687
-239    688
-238    690
-237    694
-236    695
-235    698
-233    702
-232    706
-231    708
-230    709
-229    713
-228    716
-227    719
-226    726
-225    731
-224    739
-223    741
-222    744
-221    748
-220    750
-219    754
-218    756
-217    758
-216    760
-215    768
-214    773
-213    778
-212    784
-211    788
-210    792
-209    794
-208    799
-207    802
-206    808
-205    813
-204    815
-203    819
-202    822
-201    825
-200    828
-199    832
-198    836
-197    844
-196    848
-195    852
-194    854
-193    861
-192    866
-191    871
-190    877
-189    883
-188    887
-187    896
-186    899
-185    904
-184    914
-183    918
-182    923
-181    929
-180    938
-179    945
-178    952
-177    957
-176    961
-175    966
-174    971
-173    977
-172    986
-171    992
-170    1001
-169    1010
-168    1015
-167    1017
-166    1025
-165    1033
-164    1042
-163    1047
-162    1057
-161    1072
-160    1080
-159    1090
-158    1094
-157    1107
-156    1116
-155    1123
-154    1135
-153    1141
-152    1151
-151    1158
-150    1169
-149    1179
-148    1192
-147    1201
-146    1208
-145    1218
-144    1223
-143    1231
-142    1239
-141    1249
-140    1262
-139    1269
-138    1281
-137    1289
-136    1303
-135    1310
-134    1318
-133    1330
-132    1339
-131    1349
-130    1358
-129    1369
-128    1376
-127    1386
-126    1402
-125    1409
-124    1421
-123    1435
-122    1448
-121    1466
-120    1483
-119    1494
-118    1506
-117    1520
-116    1535
-115    1560
-114    1577
-113    1587
-112    1602
-111    1619
-110    1629
-109    1642
-108    1661
-107    1685
-106    1703
-105    1726
-104    1744
-103    1760
-102    1777
-101    1800
-100    1820
-99 1843
-98 1858
-97 1880
-96 1909
-95 1927
-94 1956
-93 1986
-92 2009
-91 2029
-90 2057
-89 2086
-88 2114
-87 2147
-86 2168
-85 2188
-84 2219
-83 2249
-82 2289
-81 2316
-80 2351
-79 2384
-78 2412
-77 2454
-76 2514
-75 2543
-74 2577
-73 2613
-72 2653
-71 2691
-70 2728
-69 2769
-68 2818
-67 2862
-66 2900
-65 2942
-64 2989
-63 3039
-62 3086
-61 3136
-60 3200
-59 3267
-58 3327
-57 3387
-56 3448
-55 3509
-54 3567
-53 3655
-52 3737
-51 3810
-50 3885
-49 3959
-48 4056
-47 4129
-46 4225
-45 4323
-44 4406
-43 4500
-42 4624
-41 4735
-40 4834
-39 4967
-38 5076
-37 5212
-36 5374
-35 5534
-34 5709
-33 5865
-32 6056
-31 6270
-30 6478
-29 6694
-28 6947
-27 7184
-26 7454
-25 7761
-24 8082
-23 8432
-22 8857
-21 9265
-20 9696
-19 10217
-18 10769
-17 11369
-16 12013
-15 12800
-14 13703
-13 14699
-12 15829
-11 17109
-10 18613
-9  20462
-8  22625
-7  25440
-6  28995
-5  33821
-4  40800
-3  51525
-2  70197
-1  111461
0   220498
#这个是按照转录本的表达量进行的排序
接下来我们就将对转录本进行过滤
yeyuntian@yeyuntian-rescuer-r720-15ikbn:~/trinitytest/downstr/RSEMout/RSEMout$ $TRINITY_HOME/util/filter_low_expr_transcripts.pl --matrix RSEM.isoform.TMM.EXPR.matrix --transcripts ../../Trinity.fasta --min_expr_any 3 --hightest_iso_only --gene_to_trans_map ../../Trinity.fasta.gene_trans_map > Trinity.fasta.filter 
......
.....
....
...
..
.
-excluding TRINITY_DN63345_c1_g1_i1, max_expr: 0.633 < 3
-excluding TRINITY_DN63317_c1_g1_i1, max_expr: 1.571 < 3
-excluding TRINITY_DN63307_c0_g1_i1, max_expr: 0.786 < 3
-excluding TRINITY_DN63307_c0_g1_i2, max_expr: 0.414 < 3
-excluding TRINITY_DN63324_c0_g1_i1, max_expr: 1.716 < 3
-excluding TRINITY_DN63282_c0_g1_i1, max_expr: 0.903 < 3


    Retained 51343 / 220498 = 23.29% of total transcripts.

可以看到,这个过程中我们过滤掉了大量的转录本仅仅留下了5万左右的序列
对脚本进行一个讲解
$TRINITY_HOME/util/filter_low_expr_transcripts.pl |\
--matrix RSEM.isoform.TMM.EXPR.matrix \ #采用的脚本名称与路径
--transcripts ../../Trinity.fasta \ #需要过滤的转录本
--min_expr_any 3 \ # 设置过滤阈值
--hightest_iso_only \ #仅保留一个基因中表达量最高的那个转录本
--gene_to_trans_map ../../Trinity.fasta.gene_trans_map\ #转录本与基因的对应关系表
> Trinity.fasta.filter  #输出的过滤后的fasta文件
另外一个Salmon的结果也是可以通过同样的方式进行过滤处理。

那么今天就把相关的基因表达均一化这边的工作做完了,应该说经过这个工作后所有的基因的表达量已经完成计算,后期就是通过差异表达的软件进行一个差异分析就可以进入可视化阶段了。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 199,902评论 5 468
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 84,037评论 2 377
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 146,978评论 0 332
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 53,867评论 1 272
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 62,763评论 5 360
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,104评论 1 277
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,565评论 3 390
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,236评论 0 254
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,379评论 1 294
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,313评论 2 317
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,363评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,034评论 3 315
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,637评论 3 303
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,719评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,952评论 1 255
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,371评论 2 346
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 41,948评论 2 341

推荐阅读更多精彩内容