🎨
booknote
  • Zpliu'Booknote
  • ggplot2
    • 不继承原有数据
    • Untitled Folder 1
      • 直方图绘制
    • 02基于Github笔记实现
    • 回归分析
    • 饼图
    • Theme函数
    • 直方图
    • 分面
    • pheatmap
    • 折线图
    • 桑基图
    • GO富集分析图
    • jupyter内使用R
    • 维恩图
    • 自定义图例
    • ggridges 山峦图
    • GO气泡图
    • 散点图
    • 从数据框中计算频率
    • 箱型图
  • 前端操作
    • 实例练习
      • 动态搜索网页
        • 后端
          • Node 服务框架
          • primer数据表的增删改查
          • 前端post请求
          • login 验证
          • Vue模板
            • Vue-router前端渲染
            • main.vue
          • 基于cookie登录验证
          • 使用mysql包进行数据库的交互
          • 数据库表
            • 学生信息表
            • 用户登录表
            • mysql 事务
            • 教师表
            • 引物表
          • mysql服务
          • html模板页面
            • 错误模板页
          • 08文件上传与下载
        • 解决webpack打包后文件过大问题
        • 前端
          • vue
            • 基于element-ui框架
            • 06 个人主页
            • 08上传组件el-upload
            • element-ui
            • Vue 构建前端框架
            • login登录界面
            • 07表格多选
            • show-data页面
          • vue-cookie
          • vue-router
            • 路由组件传参
        • Appach代理服务转发node
      • pie-progress
        • 01
      • 登录界面
      • Untitled
    • JavaScript
      • fasta文件校验
      • codewar中的练习题
      • 6kyu
      • chapter03
        • 数据类型
      • tweenjs
    • css
      • CSS布局
      • 02定位
    • 前端使用ajax进行异步请求
    • gitbook
    • html
      • 03表格
      • Vue星空
    • Log for study
  • 可变剪切
    • 第六次分析
      • 设计引物
      • 多倍化过程中的变化3
      • 不同棉种间AS的差异
      • At与Dt中不存在保守转录本的基因
      • AS调控基因表达
      • 多倍化过程中变化2
      • 可变剪切统计
      • 可变剪切的进化分析
      • 保守AS模式的鉴定
      • 提纲
      • 可变剪切的翻译分析
      • 多倍化过程中isoform的变化
      • 表观遗传在AS中的作用
      • 全长转录本数据的统计
      • 表观遗传在AS中的作用2
    • 03表观遗传与可变剪切
    • 数据处理流程
      • 计算同源基因间AS的保守程度
      • 重新开始鉴定AS.md
      • 统计IR保守性比例
      • 基因分类
      • 20200111可变剪切数目统计
      • 完全保守的基因对
      • 20200315
      • 20200214
      • 第三个结果
      • 20191230对AS类型进行定义
      • AS保守程度的统计
      • 20200219合并IR
      • 20200320
      • IR事件保守的长度
      • 分析同源基因中发生IR事件的频率
      • 保守的IR的长度统计
      • 筛选基因用于GO富集分析
      • 2020102把没有发生剪切事件的位置找出来
      • 对剪切事件进行分类
      • 06比较不同棉种中isform的差异
      • 甲基化数据处理
      • 寻找motif
      • 根据IR的保守程度对基因进行GO富集分析
      • 分析同源基因间可变剪切的差异
      • 基于前面已经分好的类进行统计
      • 寻找同源基因对应的位点
      • 对同源基因的剪切事件进行分类.md
      • 分析染色体上各种特征
      • HIN1下游调控基因的分析
      • intron 分布
      • 20200102GO富集分析
      • 01全长转录组数据处理
      • 甲基化重复间的处理
    • 文献理解
      • 10核小体定位决定外显子识别
      • 22
      • 09梨树中两个亚基因组经历unbiased 进化
      • 11RNA介导的局部染色质修饰对可变剪切的调控
      • 19讨论染色质开放程度与IR的关系
      • 03植物中的表观遗传
      • 06甲基化在拟南芥开花过程中的研究
      • 20可变剪切的进化
      • 14干旱积累对HIN1蛋白剪切效率的影响
      • 18内含子保留事件中不断变化的范式和调控方式
      • 04从RNA-seq研究可变剪切
      • 16多种RNA-seq策略揭示棉花中高精度的转录态势
      • 07ChIp-seq测序原理 chromatin immunoprecipitation
      • 05甲基化测序数据比对原理
      • 13使用iso-seq分析高粱转录本数据
      • 15POWERDRESS与HDA9相互作用促进去乙酰化
      • 12通过转录与染色质结构的耦合调控可变剪切
      • 英语句子
      • paper list
      • 01多组学数据揭示表观遗传
      • 02A global survey of alternative splicing in allopolyploid cotton: landscape, complexity and regulat
      • 17可变剪切与表观遗传导致白血病
      • 21smallRNA与DNA甲基化
    • 文章提纲
    • AS多倍化过程中的变化
    • 软件使用
      • 01三代测序Iso-seq
      • Bedtools
      • iso-seq测序2.0版本
      • 02Chip-seq操作流程
      • EMBOSS
      • 05鉴定duplicate gene
      • 07kobas本地进行注释
      • MEME本地化
      • DNA甲基化分析流程
      • stringtie
    • 第7个结果
    • 原始数据处理
      • 01三代测序数据原理
      • 02测序read数目统计
    • 第8个结果
    • 第五次分析
      • isoform水平分析
      • rmats2sashimiplot
      • 可变剪切的鉴定
      • 使用单个样本的数据进行AS分析
    • 表观遗传
    • 保守AS的鉴定
    • 第四次分析了
      • 甲基化计算
      • AS统计
      • 分析IR在各个基因组的保守性
    • 第三次对AS进行统计
      • 鉴定DRMs区域
      • 04
      • 重新下载原始数据进行比对
      • 02
      • 01
    • 第三个结果
    • 原始read的分类
    • 表观数据分析
    • 从RNA-seq研究可变剪切
  • 文献
    • 表观遗传
      • 植物中甲基化机制以及靶向操纵工具
    • 陈增建老师
      • 文章
    • 可变剪切
      • Post-transcriptional splicing of nascent RNA contributes to widespread intron retention in plants
      • Variant phasing and haplotypic expression from long-read sequencing in maize
      • 02
      • 01
      • 可变剪接的研究进展及展望
      • 06
      • Co-expression networks reveal the tissue-specific regulation of transcription and splicing
    • panGenome
      • 番茄中广泛的结构变异对基因表达和性状改良中的作用
    • TWAS
      • TWAS解读
    • 数量遗传older
      • Reinventing quantitative genetics for plant breeding: something old, something new, something borrow
    • Untitled 1
    • 多倍化
      • Measuring and interpreting transposable element expression
      • Homoeolog expression bias and expression level dominance (ELD) in four tissues of natural allotetrap
    • 转录调控
      • 指导植物RNA聚合酶II转录的‘GPS’
      • 02综述
    • 3D基因组
      • Methods for mapping 3D chromosome architecture
      • 由粘连蛋白介导的人类基因组中染色体loop图谱
      • 经典Hi-C文献
      • 小麦染色质被组装成基因组疆域和转录工厂
      • Lamina-associated domains: peripheral matters and internal affairs
      • Three-dimensional chromatin landscapes in T cell acute lymphoblastic leukemia
      • Disruption of chromatin folding domains by somatic genomic rearrangements in human cancer
      • Evolutionary dynamics of 3D genome architecture following polyploidization in cotton
      • On the existence and functionality of topologically associating domains
    • Untitled
    • GWAS
      • Population Genomic Analysis and De Novo Assembly Reveal the Origin of Weedy Rice as an Evolutionary
  • CRISP Case9
    • sgRNA设计
    • 01编辑效率检测
    • Hi-TOM
    • 02检查单株覆盖度
  • python
    • matplotlib
      • 图片的基本设置
      • 韦恩图
      • 折线图
      • 堆积直方图
      • 散点图
      • imshow绘制热图
    • 爬虫
      • 根据关键字获取对应的基因
      • TE
    • 多进程
    • 基于模块化编程
    • pybedtools
      • 01API
    • 高级特性
      • 列表操作
      • pickle
    • SOS
      • Script of scripts (SOS)
    • python 解析命令行参数
    • 简单实现python多进程
    • gffutils
      • gffutils
    • 多线程读取文件
    • rpy2
      • 在jupyter中调用R代码
    • pandas
      • 取数据
    • pysam
      • 01API接口
  • cottonWeb
    • 初始化项目
    • views
      • login
      • 404页面
      • register页面
    • 后端
      • Hi-C
      • 错误代码合集
      • SequenceServer搭建网页服务
      • 手把手教你搭建JBrowse-初始化应用
      • 优化JBrowse
    • Vue中使用Echarts
    • 2配置axios请求
    • 07搜索框实时推荐
    • 动画效果
    • layout布局
    • mysql
      • 基因操作
    • 路由配置
  • Vue
    • vue-route
      • 路由
    • Vue中发起ajax请求
    • 计算属性和侦听器
    • provide inject
    • 列表渲染
    • 自定义指令
    • 事件处理
    • Vue项目
      • 九宫格实现
      • 使用vue-resource进行ajax请求
      • 在项目中使用v-router
      • 新闻页面
      • 项目迁移
      • 使用Mint UI组件库
    • 案例操作
      • 02基于Github笔记实现
      • 实现购物车功能
      • Vue组建化
      • todomvc实现日程安排
    • 页面组件化
    • Vue 实例化操作
    • vue
    • 动画的渲染
    • 模板语法
    • class & style
    • 13 动画和过渡效果
    • 02guide
    • 深入了解组件化
    • 表单输入绑定
    • 条件渲染v-if
    • vue-chartjs
      • 起步
  • 并行计算
    • 实验室考试
    • 计算圆周率PI
    • 04.forthClass
    • 使用python3中的threading模块进行简单的并行计算
    • test
      • lastTest
      • 111
    • 第三节课作业
    • 05 test
    • 04test
    • 05homework
    • 04homework
    • OpenMP
    • 集群结构
    • CPU核、多线程、多进程
    • 05Class
    • 06class
    • 07class
    • 08class
  • WebPack
    • 打包css文件
    • 基于Webpack进行Vue开发
    • 处理url 图片
    • webpack 打包Vue
    • 基于webpack的路由操作
    • webpack
  • VueCLI
    • 03组件批量注册
    • 04拖拽插件
    • 05axios跨域问题
    • 07时间轴
    • Blast+ 网页实现
    • VueCLI 安装
    • axios请求
  • Script
    • 转录因子结合位点预测
    • BinomTest
  • mysql
    • 常见函数
      • 常见函数
      • 函数
    • 查询
      • 排序查询
      • 联合查询
      • 基本查询语句
    • 字段约束条件
    • SQLyog
    • 修改
      • 修改
    • powerdesigner数据库模型设计
    • 插入
      • 插入数据
    • 事务
      • 事务
    • 添加新用户
    • 视图
      • 视图
  • 文本编辑器
    • vscode 连接数据库
    • Vue模板补齐
    • visual Studio Code
  • source_code
    • Untitled
    • 并行计算
      • 04test
    • 公众号
      • RNA-seq
    • Untitled 1
  • GWAS
    • QQ-plot
  • RNA-seq
    • 01AnalysisFlow
    • 02脚本批量提交
    • 差异表达基因
    • 文献
      • 01SPL1赋予植物热忍受能力
    • 02 建库方式
  • Linux
    • LSF
    • 02诺和致源下载数据
    • 配置阿里yum源
    • linux三剑客
    • 云梯
    • 取文件相同列
    • root基本命令
    • 服务器网站数据搬迁
    • shell脚本激活Conda环境
    • 使用vscode与服务端R交互
    • 如何使用Conda
    • vim常见使用方法
    • oh-my-zsh
    • bash中的字典与数组
  • SNP分子标记
    • vcf文件处理
  • 生信软件
    • samtools
    • bedtools
    • annovar注释SNP
    • HiC-Pro安装
    • Untitled
    • bwa使用
  • Hi-C
    • 软件
      • HiCPlotter安装
      • pre程序
    • 20200102计算共线性区间保守的boundary
    • 20200108保守的TAD
    • PanGenome
      • PanGenome与各个元件进行注释
      • Pan-Genome数据比对
      • 鉴定两个基因组之间重排
  • node
    • mysql
      • 使用Promise封装
      • 基本的SQL语句
      • mysql的增删改查
      • 在node中使用mysql
    • session与cookie保留用户登录状态
    • MongoDB
      • MongoDB中的SQL语句
      • MongoDB 数据库
      • mongoose中一些常用的查询语句
      • :pig_nose: node中使用MongoDB的实例
      • MongoDB关联查询
      • 设计数据模型
    • 保持数据库处于连接状态
    • npm
    • node中路由设计
    • express中中间件的概念
    • art-template模块的用法
    • curd增删改查的使用
    • Promise 异步编程
    • 关于express框架的学习
    • express-session
    • 配置log4js
  • Cell-Ranger
    • count输出文件夹
      • ANALYSIS
      • feature_bc_matrix文件夹
      • Analysis 结果
      • BARcoded BAM
    • CellRanger aggr
    • 10X genomics测序中用到的术语
    • single sample Analysis
    • Cell Ranger count使用手册
  • HOX3
    • 03共表达分析
    • 01RNA-seq
    • 02基因差异表达分析
  • vue-admin
    • 项目目录结构
  • R
    • dplyr
      • dpylr
      • 过滤数据框
  • 系统遗传学
    • 翻译综述
    • 从脊椎动物的视角解析衰老的遗传机制
    • 01
  • eQTL
    • PEER
      • PEER方法
      • 软件使用
    • 群体结构
      • bcftools
  • sQTL
    • HISAT2比对
    • 02数据处理
  • 资源
    • hexo服务搭建
    • 转录因子数据库
    • 前端资源
    • 01 优雅的PPT设计
    • 文章书写规范
  • SVG
    • 01起步
  • 王悦瑾
    • Bash练习题
    • Bash脚本
    • 9_28起步
  • ES6
    • 模板字符串
    • promise源码解析
    • 01
  • scRNAseq
    • 干细胞不对称分裂
      • Root stem cell niche organizer specification by molecular convergence of PLETHORA and SCARECROW tran
    • 茉莉酸代谢
    • 老年痴呆
  • 多倍体进化
    • 棉花进化
    • 棉属A基因组的起源与进化
  • Vuex
    • 解构前端登录请求
    • VueX
  • ElementUI
    • 源码学习
      • 01drawer
    • Element UI:rocket:
  • reference周记
    • 第一期
    • test
  • 苏柃
    • Bash练习
Powered by GitBook
On this page
  • 测序数据如下图
  • 统计测序序列情况
  • 比较测序数据与参考基因组数据中isform的长度与对应exon的数目
  • 看看比例TM-1
  • 看看比例A2
  • 看看比例D5
  • 提取可变剪切文件中所有isform的exon坐标
  • 提取Alter exon的坐标
  • Alternative Exon需要把对应的链的信息给补充完整
  • 把四个坐标中甲基化位点为0的exon去除试试
  • 不把intron与exon拆开看了,就分析5'|3’剪切位点附近甲基化程度和CG含量
  • 参考

Was this helpful?

  1. 可变剪切
  2. 数据处理流程

01全长转录组数据处理

Previous20200102GO富集分析Next甲基化重复间的处理

Last updated 5 years ago

Was this helpful?

测序数据如下图

  • 每个棉种含有两个重复的数据,之所以有3个文件,是因为有一个重复的数据量没有测够;之后进行了补测

2019-10-10

合并两次测序的bam文件

## 分别对两个bam文件进行排序,按照序列编号顺序排序
samtools sort -n -@ 2 ./A2/dT_BC5_subreads.bam -O BAM -o ./A2/dT_BC5_subreads_sorted.bam
## 将两个排序好的文件进行合并
samtools merge -n -@ 2 -O BAM ./A2/A2_R2.subreads.bam ./A2/dT_BC5_subreads_sorted.bam ./A2/m54139_180604_080709.subreads_sorted.bam

后来发现还得使用ccs方法将两个bam文件指定为一个数据集

2019-10-11

因为在进行数据打磨时报错了

Missing .pbi file

dataset create A2_R2.subreadset.xml --type SubreadSet --generateIndices ./../dT_BC5_subreads.bam ./../m54139_180604_080709.subreads.bam
# 之后使用A2_R2.subreadset.xml文件代替bam文件进行ccs即可

2019-10-13

使用iso-seq中dataset程序处理,重复二的数据

dataset create R2/TM1_R2.subreadset.xml --type SubreadSet --generateIndices R1801371_QJ_BC1_subreads.bam m54139_180607_052119.subreads.bam &
dataset create R2/D5_R2.subreadset.xml --type SubreadSet --generateIndices m54136_180730_021327.subreads.bam m54139_180609_044201.subreads.bam &

使用ccs处理

ccs --noPolish --minPasses 1 --minLength 300 --minSnr 4 --maxLength 10000 --maxDropFraction 0.8 --minPredictedAccuracy 0.8 --numThreads 20 --logFile ./TM1_R2_ccs.log --reportFile ./TM1_R2port_ccs.txt ./TM1_R2.subreadset.xml  ./TM1_R2_ccsout.bam

之前数据的分析,师姐已经完成了;接下来主要是针对数据进行个性化的分析了;其实我还挺想自己把流程走一遍的,可惜公司不会把分析流程的protocol发给我们

2019-10-14

将之前的结果解压,到当前文件夹

unrar x result.rar

参考我之前写的软件使用说明

tps://zpliu.gitbook.io/booknote/ke-bian-jian-qie/ruan-jian-shi-yong/01-san-dai-ce-xu-isoseq#2-shi-yong-ccs-dui-yuan-shi-shu-ju-jin-hang-guo-lv

统计测序序列情况

1.二倍体亚洲棉

数据来源:第03三步分析流程里文件Classify_stat.xls

CO_31

序列类型

数目

比例

consensus reads质控后经过ccs处理

320874

100%

non-full-length reads

34265

10.68%

full-length reads(包括chimeric reads)

286277

89.22%

filtered short reads长度小于300bp

332

0.1%

chimeric reads

9710

3.03%

CO_32

序列类型

数目

比例

consensus reads质控后经过ccs处理

292447

100%

non-full-length reads

34265

10.68%

full-length reads(包括chimeric reads)

228041

77.98%

filtered short reads长度小于300bp

366

0.13%

chimeric reads

11003

3.77%

  1. 四倍体陆地棉

    Col31&C0l32

    序列类型

    数目

    比例

    consensus reads质控后经过ccs处理

    685383

    100%

    non-full-length reads

    103674

    15.13%

    full-length reads(包括chimeric reads)

    581611

    84.86%

    filtered short reads长度小于300bp

    98

    0.01%

    chimeric reads

    18914

    2.76%

  2. 二倍体雷蒙德氏棉

    Col31&C0l32

    序列类型

    数目

    比例

    consensus reads质控后经过ccs处理

    487063

    100%

    non-full-length reads

    87450

    17.95%

    full-length reads(包括chimeric reads)

    399112

    81.94%

    filtered short reads长度小于300bp

    501

    0.1%

    chimeric reads

    26652

    5.47%

​

比较测序数据与参考基因组数据中isform的长度与对应exon的数目

  • 在测序数据中06_Alignment/all.collapsed.gff文件中有每条isform的信息

    1.统计每条isform的长度信息,只包含外显子的长度

    2.统计每条isform的外显子数目

    sed 's/gene_id [^t]*transcript_id//g' all.collapsed.gff |awk '$3~/^e/{isformLen[$9]+=$5-$4+1;exonCount[$9]+=1}END{for(i in isformLen){printf i"\t"isformLen[i]"\t"exonCount[i]"\n"}}'
    ##得到每个isform的长度和外显子数目
    "PB.1024.1";    4680    5
    "PB.10242.1";   3658    7
    "PB.1024.2";    4463    5
    "PB.10243.1";   2680    3
  • 参考基因组gff文件中有每个mRNA的注释信息

    多了一个sed的处理主要是isform的第九列多了·一些信息ID=evm.model.Ga01G0001.exon2,把exon那部分去除后获得isform编号

    awk -F ";" '{print $1}' Ghirsutum_gene_model.gff3|sed 's/\.exon.*//g' |awk '$3~/^e/{isformLen[$9]+=$5-$4+1;exonCount[$9]+=1}END{for(i in isformLen){printf i"\t"isformLen[i]"\t"exonCount[i]"\n"}}'
  • 准备绘图的数据

    # 将isform名字信息修改成分组信息
     sed -i 's/\"PB[^\t]*/TM1_PBisform/g' my_isform_length_exonCount.txt
    # 修改基因组的isform信息
    sed -i 's/\ID=[^\t]*/TM1_genome/g' my_genome_isform_length_exonCount.txt
    # 将多个棉种的数据合并成一个文件,比较外显子数目上的差异
    awk '{exonClass[$1"*"$3]+=1}END{for(i in exonClass){split(i,tmp,"*");printf tmp[1]"\t"tmp[2]"\t"exonClass[i]"\n"}}' all_genome_isform_comprasion.txt      >all_genome_isform_exonCount.txt

    得到每个基因组中isform的外显子数目分布情况

    #基因组    外显子数目    对应的isform数目
    TM1_genome    64    3
    D5_PBisform    43    7
    D5_genome    16    674
    TM1_genome    65    1
    D5_PBisform    44    13
    D5_genome    30    51

2019-10-16

  • 绘制isform长度比较信息,和外显子数目的比较信息

    #绘制isform长度信息
    ggplot(data = tmp,aes(x=tmp$V2,y=tmp$V3,fill=tmp$V2))+geom_boxplot()+ facet_wrap(~tmp$V1,scales = "free")+
  # 绘制isform中外显子的数目信息
  ggplot(data = tmp,aes(x=tmp$V3,y=tmp$V4,fill=tmp$V2))+geom_bar(stat = "identity", position = 'dodge')+scale_x_continuous(breaks = seq(1,20,1))+facet_wrap(~tmp$V1)

2019-10-17

第7个文件夹annotation中包含了,与参考基因组注释文件进行合并后的注释信息

利用地6步分析中得到的非冗余的isform序列,与基因组进行比较

棉种

非冗余的isform

比对到注释基因的isform

没有比对到基因区域

对应基因数

对应的转录本数

原参考注释基因数目

TM1

89,411

83,281

6,130

32,003

39,098

70199

A2

7,2393

69,179

3,214

20,907

参考基因组没有预测不同转录本

40960

D5

55,381

53,058

2,323

18,904

24,368

37505

第8个和第9个、10个文件的数据暂时用不到

分析第11个关于可变剪切的文件

分析不同棉种中可变剪切的类型,及发生可变剪切的基因数目

grep ExonS splice.as.xls|wc -l 统计外显子跳跃事件的数目

grep ExonS splice.as.xls|awk '{print $2}' |sort|uniq |wc -l 统计对应的基因数目

剪切事件数目/对应的基因数目

棉种

gene 总数目

事件总数目

TM-1

23137

121567

A2

11733

60921

D5

14483

81392

棉种

ES(ExonS)

IR(IntronR)

AltD

AltA

AltP

Other

TM1

5824/3519

70132/18813

13147/7329

15631/8522

8182/4201

8650/3621

A2

2536/1564

38121/9515

4746/2736

6129/3278

4764/2318

4624/1975

D5

5502/3005

42372/11062

8104/4713

11799/6094

5980/3046

7634/2810

看看比例TM-1

事件类型

事件比例与数目

基因数目与比例

IR

70132~57%

18813~81%

AD

13147~10.8%

7329~31.6%

AA

15631~12.8%

8522~36.8%

ES

5824~4.8%

3519~15.2%

AP

8182~6.7%

4201~18.1%

Other

8650~7.1%

3621~15.6%

看看比例A2

事件类型

事件比例与数目

基因数目与比例

IR

38121~62.5%

9515~81%

AD

4746~7.8%

2736~23.3%

AA

6129~10%

3278~27.9%

ES

2536~4.1%

1564~13.3%

AP

4764~7.8%

2318~19.7%

Other

4624~7.6%

1975~16.8%

看看比例D5

事件类型

事件比例与数目

基因数目与比例

IR

42372~52%

11062~76%

AD

8104~9.9%

4713~32.5%

AA

11799~14.5%

6094~42%

ES

5502~6.7%

3005~20.7%

AP

5980~7.3%

3046~21%

Other

7634~9.4%

2810~19.4%

D5的剪切事件相对与A2来说有点偏高,可能是由于A2的参考基因组本身就没有对多个转录本进行预测;为了验证这个猜想,就只看PBc得到的转录本之间的剪切事件

棉种

ES(ExonS)

IR(IntronR)

AltD

AltA

AltP

Other

TM1

1225/916

18218/5901

2532/1641

3088/1926

2797/1532

2609/1264

A2

1253/840

17865/5347

2201/1444

2945/1803

2358/1312

2571/1068

D5

504/368

9578/3160

1112/770

1438/901

1379/858

1466/735

# 批量统计次数
for i in 1; do 
awk '$6~/^PB/&&$7~/^PB/{print $0}' splice.as.xls |grep ExonS|wc -l; 
awk '$6~/^PB/&&$7~/^PB/{print $0}' splice.as.xls |grep ExonS|awk '{print $2}' |sort|uniq |wc -l; 
awk '$6~/^PB/&&$7~/^PB/{print $0}' splice.as.xls |grep IntronR|wc -l; 
awk '$6~/^PB/&&$7~/^PB/{print $0}' splice.as.xls |grep IntronR|awk '{print $2}' |sort|uniq |wc -l; 
awk '$6~/^PB/&&$7~/^PB/{print $0}' splice.as.xls |grep AltD|wc -l; 
awk '$6~/^PB/&&$7~/^PB/{print $0}' splice.as.xls |grep AltD|awk '{print $2}' |sort|uniq |wc -l; 
awk '$6~/^PB/&&$7~/^PB/{print $0}' splice.as.xls |grep AltA|wc -l;
awk '$6~/^PB/&&$7~/^PB/{print $0}' splice.as.xls |grep AltA|awk '{print $2}' |sort|uniq |wc -l; 
awk '$6~/^PB/&&$7~/^PB/{print $0}' splice.as.xls |grep AltP|wc -l; 
awk '$6~/^PB/&&$7~/^PB/{print $0}' splice.as.xls |grep AltP|awk '{print $2}' |sort|uniq |wc -l; 
awk '$6~/^PB/&&$7~/^PB/{print $0}' splice.as.xls |grep Other|wc -l; 
awk '$6~/^PB/&&$7~/^PB/{print $0}' splice.as.xls |grep Other|awk '{print $2}' |sort|uniq |wc -l; done

2019-10-18

在第7个文件夹中matchAnnot_result.txt文件中包含比对到参考基因组上的isform和对应的参考基因编号

分析全长转录组的数据与原始数据相比在isform数目上的差异

2019-11-2

  • 根据参考基因组的注释文件,产生剪切位点的bed文件

    假定剪切复合体是以外显子识别的模式进行剪切的,并且不关心外显子在正负链上的关系

#将第9列改造成只剩下基因ID,结合exon的起始位点,给每个exon一个编号,不分析脚手架了
sed 's/\;.*//g' ../Ghirsutum_gene_model.gtf |sed 's/transcript_id //g' |sed 's/\"//g'|awk '$1~/Gh/&&$3~/exon/{print $1"\t"$4"\t"$5"\t"$7"\t"$9"_"$4}' >tmp.bed
awk  '$1~/Chr/{print $1"\t"$2"\t"$3"\t"$4"\t"$5"_"$2}' constitutiveExon.bed >tmp.bed

### 结果如下
Ghir_A01        13133   13156   -       Ghir_A01G000010.1_13133
Ghir_A01        13840   14080   -       Ghir_A01G000010.1_13840
Ghir_A01        14164   15594   -       Ghir_A01G000010.1_14164
  • 生成各种类型的剪切

    # 生成5'外显子区域的bed文件,覆盖到每个碱基
    awk '{for(i=$2-1;i<=$2+73;i++){print $1"\t"i"\t"i"\t"$4"\t"$5"_"i-$2+1}}' tmp.bed >exon_5.bed 
    awk '{for(i=$3-73;i<=$3+1;i++){print $1"\t"i"\t"i"\t"$4"\t"$5"_"i-$3+73}}' tmp.bed >exon_3.bed
    awk '{for(i=$2-201;i<=$2-2;i++){print $1"\t"i"\t"i"\t"$4"\t"$5"_"i-$2+201}}' tmp.bed >intron_5.bed 
    awk '{for(i=$3+2;i<=$3+201;i++){print $1"\t"i"\t"i"\t"$4"\t"$5"_"i-$3-2}}'  tmp.bed >intron_3.bed
    
    # 用于提取指定区域的fasta序列
    awk '{print $1"\t"$2-1"\t"$2+73"\t"$4"\t"$5}' tmp.bed >exon_5_fasta.bed
    awk '{print $1"\t"$3-73"\t"$3+1"\t"$4"\t"$5}' tmp.bed >exon_3_fasta.bed
    awk '{print $1"\t"$2-201"\t"$2-2"\t"$4"\t"$5}' tmp.bed >intron_5_fasta.bed
    awk '{print $1"\t"$3+2"\t"$3+201"\t"$4"\t"$5}' tmp.bed >intron_3_fasta.bed
    
    # for 循环执行
    for i in 1
    do
    sed 's/\;.*//g' ../Ghirsutum_gene_model.gtf |sed 's/transcript_id //g' |sed 's/\"//g'|awk '$1~/Gh/&&$3~/exon/{print $1"\t"$4"\t"$5"\t"$7"\t"$9"_"$4}'|awk '{for(i=$2-1;i<=$2+73;i++){print $1"\t"i"\t"i"\t"$4"\t"$5"_"i-$2+1}}'  >exon_5.bed 
    sed 's/\;.*//g' ../Ghirsutum_gene_model.gtf |sed 's/transcript_id //g' |sed 's/\"//g'|awk '$1~/Gh/&&$3~/exon/{print $1"\t"$4"\t"$5"\t"$7"\t"$9"_"$4}'|awk '{for(i=$3-73;i<=$3+1;i++){print $1"\t"i"\t"i"\t"$4"\t"$5"_"i-$3+73}}' >exon_3.bed
    sed 's/\;.*//g' ../Ghirsutum_gene_model.gtf |sed 's/transcript_id //g' |sed 's/\"//g'|awk '$1~/Gh/&&$3~/exon/{print $1"\t"$4"\t"$5"\t"$7"\t"$9"_"$4}'|awk '{for(i=$2-201;i<=$2-2;i++){print $1"\t"i"\t"i"\t"$4"\t"$5"_"i-$2+201}}'  >intron_5.bed 
    sed 's/\;.*//g' ../Ghirsutum_gene_model.gtf |sed 's/transcript_id //g' |sed 's/\"//g'|awk '$1~/Gh/&&$3~/exon/{print $1"\t"$4"\t"$5"\t"$7"\t"$9"_"$4}'|awk '{for(i=$3+2;i<=$3+201;i++){print $1"\t"i"\t"i"\t"$4"\t"$5"_"i-$3-2}}' >intron_3.bed
    sed 's/\;.*//g' ../Ghirsutum_gene_model.gtf |sed 's/transcript_id //g' |sed 's/\"//g'|awk '$1~/Gh/&&$3~/exon/{print $1"\t"$4"\t"$5"\t"$7"\t"$9"_"$4}'|awk '{print $1"\t"$2-1"\t"$2+73"\t"$4"\t"$5}' >exon_5_fasta.bed
    sed 's/\;.*//g' ../Ghirsutum_gene_model.gtf |sed 's/transcript_id //g' |sed 's/\"//g'|awk '$1~/Gh/&&$3~/exon/{print $1"\t"$4"\t"$5"\t"$7"\t"$9"_"$4}'|awk '{print $1"\t"$3-73"\t"$3+1"\t"$4"\t"$5}'  >exon_3_fasta.bed
    sed 's/\;.*//g' ../Ghirsutum_gene_model.gtf |sed 's/transcript_id //g' |sed 's/\"//g'|awk '$1~/Gh/&&$3~/exon/{print $1"\t"$4"\t"$5"\t"$7"\t"$9"_"$4}'|awk '{print $1"\t"$2-201"\t"$2-2"\t"$4"\t"$5}' >intron_5_fasta.bed
    sed 's/\;.*//g' ../Ghirsutum_gene_model.gtf |sed 's/transcript_id //g' |sed 's/\"//g'|awk '$1~/Gh/&&$3~/exon/{print $1"\t"$4"\t"$5"\t"$7"\t"$9"_"$4}'|awk '{print $1"\t"$3+2"\t"$3+201"\t"$4"\t"$5}'  >intron_3_fasta.bed
    done
  • 将甲基化的数据构造成bed文件

    awk '{print $1"\t"$2"\t"$2}' ~/WMJ_3D_DNAmethy/Gh_bismark/CpG_context_D1_binom_fdr_result.txt  >CpG_context_D1.bed
  • 统计每个区域中含有甲基化的位点的数目

    ## 如果区域没有对应的甲基化位点则会显示为-1,有则显示对于的甲基化位置
    ~/software/bedtools2-2.29.0/bin/intersectBed  -b CpG_context_D1.bed -a exon_3.bed -loj >exon_3Meth_count.txt 
    ## 统计每个区域甲基化的次数,后面几列的坐标一样的话就认为是一个甲基化位点
    # awk '$2==$7{print $0}' exon_3Meth_count.txt 
    ## 统计每个区域中单个碱基精度的甲基化程度,需要重新制作bed文件
  • 提取对应区域的CG类型的数目,进行甲基化水平的标准化

    # 统计每个区域CG含量水平
     python extract_CG_count.py sequencFile outputFile
    # 提取甲基化是单个碱基的精度下的甲基化水平
    python scale_Methlation_by_sigleBase.py  exon_3_CGcount.txt  exon_3Meth_count.txt scale_single_base.txt
    # 统计外显子的数目
    grep ">" exon_3.fasta|wc -l
    # 均一化所有外显子的单碱基水平
    sed 's/_/\t/g' scale_single_base.txt |awk '{print $(NF-1)"\t"$NF}'|awk '{a[$1]+=$2}END{for(i in a)print i"\t"a[i]/外显子数目}' >end
  • 画两幅内含子和外显子连接的图,intron5-exon5 vs exon3-intron3

    ## 将5'外显子坐标延长200,然后合并
    awk '{print $1+200"\t"$2}' exon5_end |sort -k1 -n|cat - intron5_end |sort -k1 -n >intron_exon_5.txt 
    ## 将3'内含子延长75 然后合并
    awk '{print $1+75"\t"$2}' intron3_end |cat - exon3_end |sort -k1 -n >intron_exon_3.txt
  • ggplot2绘制图形

    ## 5'端
    ggplot(data=data2,aes(x=data2$V1,y=data2$V2))+
         geom_line(color=c("#ff4757"),size=1)+
         ylim(c(0,0.008))+
         scale_x_continuous(breaks = c(0,200,274),labels = c(-200,'','+75'))+
         theme(panel.grid=element_blank(),panel.border = element_blank(),panel.background = element_rect(fill = "#f1f2f6"))+
         geom_vline(xintercept = 200,linetype="dashed",color="blue")+
         theme(axis.line=element_line(size=0.8))+xlab("")+ylab("average mCpG/CpG")
    ## 3'端
    ggplot(data=data1,aes(x=data1$V1,y=data1$V2))+
        geom_line(color=c("#ff4757"),size=1)+
        ylim(c(0,0.008))+
        scale_x_continuous(breaks = c(0,75,274),labels = c('-75','','+200'))+
        theme(panel.grid=element_blank(),panel.border = element_blank(),panel.background = element_rect(fill = "#f1f2f6"))+
        geom_vline(xintercept = 75,linetype="dashed",color="blue")+
        theme(axis.line=element_line(size=0.8))+xlab("")+ylab("average mCpG/CpG")

2019-11-08

​ 重新分析可变剪切的数据,使用gmap进行比对,过滤指标覆盖度85%,相似度90%

cat ./all.collapsed.rep.fa|~/software/gmap-2019-09-12/bin/gmap -D ~/work/Alternative/data/gmap_build/Graimondii_221_v2.0 -d Graimondii_221_v2.0 -f samse -t 10 -n 2 --min-trimmed-coverage=0.85 --min-identity=0.9  >test.sam

2019-11-14

考虑每个isform直接的比较

棉种

ES(ExonS)

IR(IntronR)

AltD

AltA

AltP

Other

TM1

17702/3440

254763/18239

37147/7111

48642/8180

13878/3441

8005/2046

A2

5074/1390

94222/9164

12407/2762

17002/3382

11798/2650

4310/1213

D5

18554/2949

148092/10583

19095/3523

31982/4988

5508/1406

5199/1279

只考虑基因坐标

棉种

ES(ExonS)

IR(IntronR)

AltD

AltA

AltP

Other

TM1

4139/3440

53689/18239

10223/7111

11951/8180

5088/3441

2823/2046

A2

1656/1390

27223/9164

3839/2762

5021/3382

4428/2650

1757/1213

D5

3863/2949

31532/10583

4903/3523

7343/4988

1892/1406

1758/1279

A2_8 vs D5_6

棉种

gene 数目

事件数目

TM1

21405

87934

A2

10861

42044

D5

12684

51616

棉种

ES(ExonS)

IR(IntronR)

AltD

AltA

AltP

Other

TM1

4139/3440

53689/18239

10223/7111

11951/8180

5088/3441

2823/2046

A2

2276/1560

28078/9203

4135/2810

5199/3376

1823/1296

1435/949

D5

4280/2958

31756/10581

4900/3427

7055/4731

1819/1303

1805/1209

2019-11-16

比较Alt exon与constituents exon的甲基化水平

提取可变剪切文件中所有isform的exon坐标

先提取PacBio对应的isform编号,以及对应的mRNA对应的编号

awk '$6~/PB/{print $6"\t"$2}' end_third |sort|uniq >PacBio_ID
awk '$7~/PB/{print $7"\t"$2}' end_third |sort|uniq >>PacBio_ID
awk '$6~/evm/{print $6"\t"$2}' end_third |sort|uniq >mRNA_ID
awk '$7~/evm/{print $7"\t"$2}' end_third |sort|uniq  >>mRNA_ID
## 还得去一次重
sort PacBio_ID|uniq >PacBio_ID_1    
## 使用python脚本将每个isform的外显子信息坐标信息进去取交集,假定在2个isform中出现的exon坐标,认为是constituents exon
python constitutiveExonLocation.py PacBio_ID mRNA_ID ../test.gff  ~/work/Alternative/data/Ga_genome/G.arboreum.Chr.v1.0.gff constitutiveExonLocation
# 给每个constitutive exon取个名字
# 最终的constitutive exon结果里可能会有重复的坐标,由于不同转录本之间太相似了,把一些重叠区域尽量最小化
sort -n -k3,3 constitutiveExon.bed |awk '{print $2,$3,$1,$4,$5}' OFS="\t"|uniq -f 1|awk '{print $2,$1,$3,$4,$5}' OFS="\t" |sort -k2,2 -n |uniq -f1 |awk '{print $3,$2,$1,$4,$5}' OFS="\t"|awk '{print $1,$2,$3,$4,$5"_"$2}' OFS="\t" >tmp.bed
# 提取对应的bed坐标文件,这有点问题没有根据链来提,会有误差
for i in 1
do
awk '{for(i=$2-1;i<=$2+73;i++){print $1"\t"i"\t"i"\t"$4"\t"$5"_"i-$2+1}}'  tmp.bed >exon_5.bed 
awk '{for(i=$3-73;i<=$3+1;i++){print $1"\t"i"\t"i"\t"$4"\t"$5"_"i-$3+73}}' tmp.bed >exon_3.bed
awk '{for(i=$2-201;i<=$2-2;i++){print $1"\t"i"\t"i"\t"$4"\t"$5"_"i-$2+201}}'  tmp.bed >intron_5.bed 
awk '{for(i=$3+2;i<=$3+201;i++){print $1"\t"i"\t"i"\t"$4"\t"$5"_"i-$3-2}}' tmp.bed >intron_3.bed
awk '{print $1"\t"$2-1"\t"$2+73"\t"$4"\t"$5}' tmp.bed >exon_5_fasta.bed
awk '{print $1"\t"$3-73"\t"$3+1"\t"$4"\t"$5}'  tmp.bed >exon_3_fasta.bed
awk '{print $1"\t"$2-201"\t"$2-2"\t"$4"\t"$5}' tmp.bed >intron_5_fasta.bed
awk '{print $1"\t"$3+2"\t"$3+201"\t"$4"\t"$5}'  tmp.bed >intron_3_fasta.bed
done
# 提取对应的序列用于计算CG含量
python ~/scripte/according_CDS_location_find_fasta_mesage.py exon_3_fasta.bed ~/work/Alternative/data/Ga_genome/G.arboreum.Chr.v1.0.fasta exon_3.fasta
python ~/scripte/extract_CG_count.py  exon_3.fasta  exon_3_CG_count.txt
# 使用intersectBed做交集
~/software/bedtools2-2.29.0/bin/intersectBed  -b CpG_context_D1.bed -a exon_3.bed -loj >exon_3Meth_count.txt 
# 提取单碱基下的甲基化水平
python scale_Methlation_by_sigleBase.py  exon_3_CGcount.txt  exon_3Meth_count.txt scale_single_base.txt
# 按exon的数目进行标准化 # 均一化所有外显子的单碱基水平
grep ">" exon_3.fasta|wc -l
sed 's/_/\t/g' scale_single_base.txt |awk '{print $(NF-1)"\t"$NF}'|awk '{a[$1]+=$2}END{for(i in a)print "AltExon\t"i"\t"a[i]/外显子数目}' >end

### 搞个for循环懒得敲了
for i in 1
do
python ~/scripte/according_CDS_location_find_fasta_mesage.py exon_3_fasta.bed ~/work/Alternative/data/Ga_genome/G.arboreum.Chr.v1.0.fasta exon_3.fasta
python ~/scripte/according_CDS_location_find_fasta_mesage.py exon_5_fasta.bed ~/work/Alternative/data/Ga_genome/G.arboreum.Chr.v1.0.fasta exon_5.fasta
python ~/scripte/according_CDS_location_find_fasta_mesage.py intron_3_fasta.bed ~/work/Alternative/data/Ga_genome/G.arboreum.Chr.v1.0.fasta intron_3.fasta
python ~/scripte/according_CDS_location_find_fasta_mesage.py intron_5_fasta.bed ~/work/Alternative/data/Ga_genome/G.arboreum.Chr.v1.0.fasta intron_5.fasta
python ~/scripte/extract_CG_count.py  exon_3.fasta  exon_3_CG_count.txt
python ~/scripte/extract_CG_count.py  exon_5.fasta  exon_5_CG_count.txt
python ~/scripte/extract_CG_count.py intron_3.fasta  intron_3_CG_count.txt
python ~/scripte/extract_CG_count.py intron_5.fasta  intron_5_CG_count.txt
~/software/bedtools2-2.29.0/bin/intersectBed  -b ~/work/Alternative/data/Ga_genome/test/CpG_context_D4.bed -a exon_3.bed -loj >exon_3Meth_count.txt 
~/software/bedtools2-2.29.0/bin/intersectBed  -b ~/work/Alternative/data/Ga_genome/test/CpG_context_D4.bed -a exon_5.bed -loj >exon_5Meth_count.txt 
~/software/bedtools2-2.29.0/bin/intersectBed  -b ~/work/Alternative/data/Ga_genome/test/CpG_context_D4.bed -a intron_5.bed -loj >intron_5Meth_count.txt 
~/software/bedtools2-2.29.0/bin/intersectBed  -b ~/work/Alternative/data/Ga_genome/test/CpG_context_D4.bed -a intron_3.bed -loj >intron_3Meth_count.txt 
python ~/scripte/scale_Methlation_by_sigleBase.py exon_3_CG_count.txt  exon_3Meth_count.txt exon_3scale_single_base.txt
python ~/scripte/scale_Methlation_by_sigleBase.py exon_5_CG_count.txt  exon_5Meth_count.txt exon_5scale_single_base.txt
python ~/scripte/scale_Methlation_by_sigleBase.py intron_5_CG_count.txt intron_5Meth_count.txt intron_5scale_single_base.txt
python ~/scripte/scale_Methlation_by_sigleBase.py intron_3_CG_count.txt intron_3Meth_count.txt intron_3scale_single_base.txt
done

### 最终结果
grep ">" intron_5.fasta |wc -l
## exon的类型记得改一下
for exonCount in 外显子的数目
do
sed 's/_/\t/g' exon_3scale_single_base.txt |awk '{print $(NF-1)"\t"$NF}'|awk '{a[$1]+=$2}END{for(i in a)print "AltExon\t"i"\t"a[i]/"'$exonCount'"}' >exon_3_end
sed 's/_/\t/g' exon_5scale_single_base.txt |awk '{print $(NF-1)"\t"$NF}'|awk '{a[$1]+=$2}END{for(i in a)print "AltExon\t"i"\t"a[i]/"'$exonCount'"}' >exon_5_end
sed 's/_/\t/g' intron_5scale_single_base.txt |awk '{print $(NF-1)"\t"$NF}'|awk '{a[$1]+=$2}END{for(i in a)print "AltExon\t"i"\t"a[i]/"'$exonCount'"}' >intron_5_end
sed 's/_/\t/g' intron_3scale_single_base.txt |awk '{print $(NF-1)"\t"$NF}'|awk '{a[$1]+=$2}END{for(i in a)print "AltExon\t"i"\t"a[i]/"'$exonCount'"}' >intron_3_end
done
### 为了画图方便将所有exon做成连续的坐标
## 将5'外显子坐标延长200,然后合并
awk '{print $1"\t"$2+200"\t"$3}' exon_5_end |sort -k2 -n|cat - intron_5_end |sort -k2 -n >intron_exon_5.txt 
## 将3'内含子延长75 然后合并
awk '{print $1"\t"$2+75"\t"$3}' intron_3_end |cat - exon_3_end |sort -k2 -n >intron_exon_3.txt

提取Alter exon的坐标

### 没有染色体正负链的信息,在后面提取序列要用,但是提取CG碱基的时候,由于对称性所以提取哪条链都没关系
### 都以正链为标准
awk '$3~/IntronR/||$3~/ExonS/{print $1,$4,$5,"+",$2}' OFS="\t"  end_third  >../Alter_exon/alter_exon.bed

2019-11-20

之间比较Constitutive Exon和Alternative Exon之间甲基化水平的差异

Alternative Exon需要把对应的链的信息给补充完整

直接根据基因区编号来补充把

## 提取基因正负链信息
cut -f5 alter_exon.bed |xargs  -I {} grep {} ~/work/Alternative/data/Ga_genome/G.arboreum.Chr.v1.0.gff|awk '$3~/gene/{print $7}' |paste alter_exon.bed - >11111111111
## 过滤重复的可变exon
awk '{print $1,$2,$3,$6,$5}' OFS="\t"  ../11111111111 |sort -n -k3,3  |awk '{print $2,$3,$1,$4,$5}' OFS="\t"|uniq -f 1|awk '{print $2,$1,$3,$4,$5}' OFS="\t" |sort -k2,2 -n |uniq -f1 |awk '{print $3,$2,$1,$4,$5}' OFS="\t"|awk '{print $1,$2,$3,$4,$5"_"$2}' OFS="\t" >tmp.bed
## 构造每个外显子在5'|3'端内含子和外显子的甲基化数据
for i in 1
do
awk '$4~/+/{print $1"\t"$2"\t"$2+74"\t"$4"\t"$5}$4~/-/{print $1"\t"$3-74"\t"$3"\t"$4"\t"$5}' ../tmp.bed  >exon_5.bed
awk '$4~/+/{print $1"\t"$3-74"\t"$3"\t"$4"\t"$5}$4~/-/{print $1"\t"$2"\t"$2+74"\t"$4"\t"$5}' ../tmp.bed >exon_3.bed
awk '$4~/+/{print $1"\t"$3+1"\t"$3+75"\t"$4"\t"$5}$4~/-/{print $1"\t"$2-75"\t"$2-1"\t"$4"\t"$5}' ../tmp.bed >intron_3.bed
awk '$4~/+/{print $1"\t"$2-75"\t"$2-1"\t"$4"\t"$5}$4~/-/{print $1"\t"$3+1"\t"$3+75"\t"$4"\t"$5}' ../tmp.bed  >intron_5.bed
done
## 长度都是一定的,提取对应的CG甲基含量
for i in 1
do
python ~/scripte/according_CDS_location_find_fasta_mesage.py  exon_3.bed  ~/work/Alternative/data/Ga_genome/G.arboreum.Chr.v1.0.fasta exon_3.fasta
python ~/scripte/according_CDS_location_find_fasta_mesage.py  exon_5.bed  ~/work/Alternative/data/Ga_genome/G.arboreum.Chr.v1.0.fasta exon_5.fasta
python ~/scripte/according_CDS_location_find_fasta_mesage.py  intron_3.bed  ~/work/Alternative/data/Ga_genome/G.arboreum.Chr.v1.0.fasta intron_3.fasta
python ~/scripte/according_CDS_location_find_fasta_mesage.py  intron_5.bed  ~/work/Alternative/data/Ga_genome/G.arboreum.Chr.v1.0.fasta intron_5.fasta
done
for i in 1
do
python ~/scripte/extract_CG_count.py  exon_3.fasta exon_3_CG_count.txt
python ~/scripte/extract_CG_count.py  exon_5.fasta exon_5_CG_count.txt
python ~/scripte/extract_CG_count.py  intron_3.fasta intron_3_CG_count.txt
python ~/scripte/extract_CG_count.py  intron_5.fasta intron_5_CG_count.txt
done
## 统计每个区域甲基化的碱基数
for i in 1
do
~/software/bedtools2-2.29.0/bin/intersectBed  -a exon_3.bed  -b ~/work/Alternative/data/Ga_genome/test/CpG_context_D4.bed -loj|awk '$6~/\./{print $5"\t"0}$6~/[^\.]/{print $5"\t"1}'|awk '{a[$1]+=$2}END{for(i in a)print i"\t"a[i]}' >exon_3Meth_count.txt
~/software/bedtools2-2.29.0/bin/intersectBed  -a exon_5.bed  -b ~/work/Alternative/data/Ga_genome/test/CpG_context_D4.bed -loj|awk '$6~/\./{print $5"\t"0}$6~/[^\.]/{print $5"\t"1}'|awk '{a[$1]+=$2}END{for(i in a)print i"\t"a[i]}' >exon_5Meth_count.txt
~/software/bedtools2-2.29.0/bin/intersectBed  -a intron_3.bed  -b ~/work/Alternative/data/Ga_genome/test/CpG_context_D4.bed -loj|awk '$6~/\./{print $5"\t"0}$6~/[^\.]/{print $5"\t"1}'|awk '{a[$1]+=$2}END{for(i in a)print i"\t"a[i]}' >intron_3Meth_count.txt
~/software/bedtools2-2.29.0/bin/intersectBed  -a intron_5.bed  -b ~/work/Alternative/data/Ga_genome/test/CpG_context_D4.bed -loj|awk '$6~/\./{print $5"\t"0}$6~/[^\.]/{print $5"\t"1}'|awk '{a[$1]+=$2}END{for(i in a)print i"\t"a[i]}' >intron_5Meth_count.txt
done

## 构造ggplot绘图的数据
for i in 1
do
awk '{print "ConExon\t""exon_3\t"$2}' exon_3_CG_count.txt  >conExon_CGcount_end
awk '{print "ConExon\t""exon_5\t"$2}' exon_5_CG_count.txt  >>conExon_CGcount_end
awk '{print "ConExon\t""intron_3\t"$2}' intron_3_CG_count.txt  >>conExon_CGcount_end
awk '{print "ConExon\t""intron_5\t"$2}' intron_5_CG_count.txt  >>conExon_CGcount_end
awk '{print "ConExon\t""exon_3\t"$2}' exon_3Meth_count.txt >conExon_MetCount_end
awk '{print "ConExon\t""exon_5\t"$2}' exon_5Meth_count.txt >>conExon_MetCount_end
awk '{print "ConExon\t""intron_5\t"$2}' intron_5Meth_count.txt  >>conExon_MetCount_end
awk '{print "ConExon\t""intron_3\t"$2}' intron_3Meth_count.txt  >>conExon_MetCount_end
done

感觉失败了

把四个坐标中甲基化位点为0的exon去除试试

#剔除在 exon_5|3 和intron3|5都没有甲基化的exon
cat exon_3Meth_count.txt exon_5Meth_count.txt intron_3Meth_count.txt intron_5Meth_count.txt|awk '$2==0{print $0}' |sort |uniq -c|awk '$1==4{print $2"\t"0}' >No_Methlation_exon.txt
for i in 1
do
cat No_Methlation_exon.txt  exon_3Meth_count.txt |sort |uniq -u >exon_3Meth_No0count.txt
cat No_Methlation_exon.txt exon_5Meth_count.txt |sort |uniq -u >exon_5Meth_No0count.txt
cat No_Methlation_exon.txt intron_3Meth_count.txt |sort |uniq -u >intron_3Meth_No0count.txt
cat No_Methlation_exon.txt intron_5Meth_count.txt |sort |uniq -u >intron_5Meth_No0count.txt
done

同样没有发现想要的效果,比如Alter 的剪切位点中exon和intron之间的甲基化程度相差不大,而Constitutive 剪切位点附近的甲基化程度相差很大

不把intron与exon拆开看了,就分析5'|3’剪切位点附近甲基化程度和CG含量

## 将同一个外显子附近的甲基化数据合并
cat *3Meth_No0count.txt|awk '{a[$1]+=$2}END{for(i in a) print "ConExon\t""3_splice\t"a[i]}' >3Meth_No0count.txt
cat *5Meth_No0count.txt|awk '{a[$1]+=$2}END{for(i in a) print "ConExon\t""5_splice\t"a[i]}' >5Meth_No0count.txt

佛了,想要差异大一些又没差异

参考

constitutive exon与alteractivate exon比较
剪切位点intron与exon甲基化程度比较
剪切位点附近甲基化程度的差异

bedtools使用

ggplot2 标签修改

https://www.jianshu.com/p/6c3b87301491
https://blog.csdn.net/Bone_ACE/article/details/47427453#