热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

生信分析常用文件格式

USSC上的文件格式汇总1.BED 某些翻译软件可能翻译为床文件,其实是叫BrowserExtensibleData,直译就是浏览器拓展

USSC上的文件格式汇总

1.BED 

某些翻译软件可能翻译为床文件,其实是叫Browser Extensible Data,直译就是浏览器拓展数据。

三个必须的列:The first three required BED fields are:

chrom – The name of the chromosome (e.g. chr3, chrY, chr2_random) or scaffold (e.g. scaffold10671).

chromStart – The starting position of the feature in the chromosome or scaffold. The first base in a chromosome is numbered 0.

chromEnd – The ending position of the feature in the chromosome or scaffold. The chromEnd base is not included in the display of the feature, however, the number in position format will be represented. For example, the first 100 bases of chromosome 1 are defined as chrom=1, chromStart=0, chromEnd=100, and span the bases numbered 0-99 in our software (not 0-100), but will represent the position notation chr1:1-100. Read more here.

关于染色体的起始位置和终止位置的坐标计数,The UCSC Genome Browser Coordinate Counting Systems有更多的解释。画的图很容易懂,用手指就可以领会。

生信分析常用文件格式
1
生信分析常用文件格式
2
生信分析常用文件格式
3

If you submit data to the browser in position format (chr#:##-##), the browser assumes this information is 1-based. If you submit data in any other format (BED (chr# ## ##) or otherwise), the browser will assume it is 0-based.  Similarly, any data returned by the browser in position format is 1-based, while data returned in BED format is 0-based.至于为什么要有这两种文件格式,留坑,我也不知道。

The 9 additional optional BED fields are:

name – Defines the name of the BED line. This label is displayed to the left of the BED line in the Genome Browser window when the track is open to full display mode or directly to the left of the item in pack mode.

score – A score between 0 and 1000. If the track line useScore attribute is set to 1 for this annotation data set, the score value will determine the level of gray in which this feature is displayed (higher numbers = darker gray).

生信分析常用文件格式
灰度

strand – Defines the strand. Either “.” (=no strand) or “+” or “-“.

thickStart – The starting position at which the feature is drawn thickly (for example, the start codon in gene displays). When there is no thick part, thickStart and thickEnd are usually set to the chromStart position.

thickEnd – The ending position at which the feature is drawn thickly (for example the stop codon in gene displays).

itemRgb – An RGB value of the form R,G,B (e.g. 255,0,0). If the track line itemRgb attribute is set to “On”, this RBG value will determine the display color of the data contained in this BED line. NOTE: It is recommended that a simple color scheme (eight colors or less) be used with this attribute to avoid overwhelming the color resources of the Genome Browser and your Internet browser.

blockCount – The number of blocks (exons) in the BED line.

blockSizes – A comma-separated list of the block sizes. The number of items in this list should correspond to blockCount.

blockStarts – A comma-separated list of block starts. All of the blockStart positions should be calculated relative to chromStart. The number of items in this list should correspond to blockCount.

参考BED文件格式

name– BED行名,在基因组浏览器左边显示;

score– 在基因组浏览器中显示的灰度设定,值介于0-1000;

strand– 正负链标记. Either “.” (=no strand) or “+” or “-“.

thickStart– feature起始位置(for example, the start codon in gene displays)。 When there is no thick part, thickStart and thickEnd are usually set to the chromStart position.

thickEnd–  feature编码终止位置 (for example the stop codon in gene displays).

itemRgb– R,G,B (e.g. 255,0,0)值,当itemRgb设置为 “On”,BED的行会显示颜色.

blockCountblocks (exons外显子)数目.

blockSizes– blocks (exons)大小列表,逗号分隔,对应于blockCount.

blockStarts-blocks (exons)起始位置列表,逗号分隔,对应于blockCount.;这个起始位置是与chromStart的一个相对位置。

生信分析常用文件格式
BED文件

如果看到bed后面有数字,比如说BED3或者BED4,数字代表的可能是列数。

2.BED detail format

包含BED格式文件的4-12列,此外还有ID和a description of the item。

track name=HbVar type=bedDetail description=”HbVar custom track” db=hg19 visibility=3 url=”http://globin.bx.psu.edu/cgi-bin/hbvar/query_vars3?display_format=page&mode=output&id=$$”chr11 5246919 5246920 Hb_North_York 2619 Hemoglobin variantchr11 5255660 5255661 HBD c.1 G>A 2659 delta0 thalassemiachr11 5247945 5247946 Hb Sheffield 2672 Hemoglobin variantchr11 5255415 5255416 Hb A2-Lyon 2676 Hemoglobin variantchr11 5248234 5248235 Hb Aix-les-Bains 2677 Hemoglobin variant

粗体字必须包含在track-line里面。

3.BedGraph Track Format

track line attribute=value pairs

track lines define the display attributes for all lines in an annotation data set.

track line定义了注释文件集的展示属性。

name=track_label>、description=center_label>、type=track_type> 、color=RRR,GGG,BBB>等等

包含了四列BED文件的内容

Following the track definition line are the track data in four column BED format:

生信分析常用文件格式
BEDGRAPH

The chromosome coordinates are zero-based, half-open.

4.FASTA和FASTQ 

1、FASTA文件的格式

在生物信息学中,FASTA格式(又称为Pearson格式)是一种基于文本的、用于表示核苷酸序列或氨基酸序列的格式。在这种格式中碱基对或氨基酸用单个字母来表示,且允许在序列前添加序列名及注释。

FASTA文件以序列表示和序列作为一个基本单元,各行记录信息如下:

第一行是由大于号”>”开头的任意文字说明,用于序列标记,为了保证后续分析软件能够区分每条序列,单个序列的标识必须具有唯一性。;

从第二行开始为序列本身,只允许使用既定的核苷酸或氨基酸编码符号。通常核苷酸符号大小写均可,而氨基酸常用大写字母。使用时应注意有些程序对大小写有明确要求。文件每行的字母一般不应超过80个字符。

2、FASTQ文件格式

FASTQ是基于文本的、保存核酸序列和其测序质量信息的标准格式。其序列以及质量信息都是使用一个ASCII字符标示,最初由Sanger开发,目的是将FASTA序列与质量数据放到一起,目前已经成为高通量测序结果的事实标准。

FASTQ文件中以四行最为一个基本单元,并对应一条序列的测序信息,各行记录信息如下:

第一行记录序列标识以及相关的描述信息,以‘@’开头,为了保证后续分析软件能够区分每条序列,单个序列的标识必须具有唯一性;

第二行为碱基序列;

第三行以‘+’开头,后面是序列标示符、描述信息,或者什么也不加;

第四行,是质量信息,长度和第二行的序列相对应,每一个序列都有一个质量评分,根据评分体系的不同,每个字符的含义表示的数字也不相同。

5.BAM/SAM

BAM is the compressed binary version of the Sequence Alignment/Map (SAM) format, a compact and index-able representation of nucleotide sequence alignments. Many next-generation sequencing and analysis tools work with SAM/BAM. 

SAM (Sequence Alignment/Map) format is a generic format for storing large nucleotide sequence alignments.

超链接可以查看以sam作为input或者output的软件。

处理大文件都需要一个索引,索引的作用是可以快速定位到文件的任意位置,因此,建立索引,也是bam文件的重要功能,而建立索引,必须是排序后的bam文件。所以,拿到一个比对好的sam之后,基本处理就是排序,格式转换,建立索引。

在bismark中有一个对基因组建立索引的步骤,但是我也不知道为什么要建立这个索引以及这个索引可以用来干什么。可能是为了提高比对的速度。留坑。

生信分析常用文件格式
建立索引

#这里的bt2结尾的文件就是索引,是二进制文件。

(1)Convert SAM to BAM using the samtools program:#将SAM文件转换为BAM文件。

    samtools view -S -b -o my.bam my.sam

If converting a SAM file that does not have a proper header, the -t or -T option is necessary. For more information about the command, run samtools view with no other arguments.

(2)Sort and create an index for the BAM:排序并且建立索引

    samtools sort my.bam my.sorted

    samtools index my.sorted.bam

The sort command appends .bam to my.sorted, creating a BAM file of alignments ordered by leftmost position on the reference assembly.

The index command generates a new file, my.sorted.bam.bai, with which genomic coordinates can quickly be translated into file offsets in my.sorted.bam.有了这个.BAI为后缀的文件基因组坐标可以快速在BAM文件中转换为文件偏移量。(看不太懂)


推荐阅读
  • 本文由编程笔记#小编为大家整理,主要介绍了logistic回归(线性和非线性)相关的知识,包括线性logistic回归的代码和数据集的分布情况。希望对你有一定的参考价值。 ... [详细]
  • 本文分享了一个关于在C#中使用异步代码的问题,作者在控制台中运行时代码正常工作,但在Windows窗体中却无法正常工作。作者尝试搜索局域网上的主机,但在窗体中计数器没有减少。文章提供了相关的代码和解决思路。 ... [详细]
  • HDU 2372 El Dorado(DP)的最长上升子序列长度求解方法
    本文介绍了解决HDU 2372 El Dorado问题的一种动态规划方法,通过循环k的方式求解最长上升子序列的长度。具体实现过程包括初始化dp数组、读取数列、计算最长上升子序列长度等步骤。 ... [详细]
  • Oracle分析函数first_value()和last_value()的用法及原理
    本文介绍了Oracle分析函数first_value()和last_value()的用法和原理,以及在查询销售记录日期和部门中的应用。通过示例和解释,详细说明了first_value()和last_value()的功能和不同之处。同时,对于last_value()的结果出现不一样的情况进行了解释,并提供了理解last_value()默认统计范围的方法。该文对于使用Oracle分析函数的开发人员和数据库管理员具有参考价值。 ... [详细]
  • 也就是|小窗_卷积的特征提取与参数计算
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了卷积的特征提取与参数计算相关的知识,希望对你有一定的参考价值。Dense和Conv2D根本区别在于,Den ... [详细]
  • 本文介绍了指针的概念以及在函数调用时使用指针作为参数的情况。指针存放的是变量的地址,通过指针可以修改指针所指的变量的值。然而,如果想要修改指针的指向,就需要使用指针的引用。文章还通过一个简单的示例代码解释了指针的引用的使用方法,并思考了在修改指针的指向后,取指针的输出结果。 ... [详细]
  • 本文介绍了在mac环境下使用nginx配置nodejs代理服务器的步骤,包括安装nginx、创建目录和文件、配置代理的域名和日志记录等。 ... [详细]
  • C++中的三角函数计算及其应用
    本文介绍了C++中的三角函数的计算方法和应用,包括计算余弦、正弦、正切值以及反三角函数求对应的弧度制角度的示例代码。代码中使用了C++的数学库和命名空间,通过赋值和输出语句实现了三角函数的计算和结果显示。通过学习本文,读者可以了解到C++中三角函数的基本用法和应用场景。 ... [详细]
  • 本文讨论了如何优化解决hdu 1003 java题目的动态规划方法,通过分析加法规则和最大和的性质,提出了一种优化的思路。具体方法是,当从1加到n为负时,即sum(1,n)sum(n,s),可以继续加法计算。同时,还考虑了两种特殊情况:都是负数的情况和有0的情况。最后,通过使用Scanner类来获取输入数据。 ... [详细]
  • 本文介绍了C++中省略号类型和参数个数不确定函数参数的使用方法,并提供了一个范例。通过宏定义的方式,可以方便地处理不定参数的情况。文章中给出了具体的代码实现,并对代码进行了解释和说明。这对于需要处理不定参数的情况的程序员来说,是一个很有用的参考资料。 ... [详细]
  • 本文主要解析了Open judge C16H问题中涉及到的Magical Balls的快速幂和逆元算法,并给出了问题的解析和解决方法。详细介绍了问题的背景和规则,并给出了相应的算法解析和实现步骤。通过本文的解析,读者可以更好地理解和解决Open judge C16H问题中的Magical Balls部分。 ... [详细]
  • 本文介绍了P1651题目的描述和要求,以及计算能搭建的塔的最大高度的方法。通过动态规划和状压技术,将问题转化为求解差值的问题,并定义了相应的状态。最终得出了计算最大高度的解法。 ... [详细]
  • 本文介绍了为什么要使用多进程处理TCP服务端,多进程的好处包括可靠性高和处理大量数据时速度快。然而,多进程不能共享进程空间,因此有一些变量不能共享。文章还提供了使用多进程实现TCP服务端的代码,并对代码进行了详细注释。 ... [详细]
  • 动态规划算法的基本步骤及最长递增子序列问题详解
    本文详细介绍了动态规划算法的基本步骤,包括划分阶段、选择状态、决策和状态转移方程,并以最长递增子序列问题为例进行了详细解析。动态规划算法的有效性依赖于问题本身所具有的最优子结构性质和子问题重叠性质。通过将子问题的解保存在一个表中,在以后尽可能多地利用这些子问题的解,从而提高算法的效率。 ... [详细]
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
author-avatar
蔡晓楠
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有