生信分析常用文件格式

USSC上的文件格式匯總

1.BED?

某些翻譯軟件可能翻譯為床文件,其實(shí)是叫Browser Extensible Data啡彬,直譯就是瀏覽器拓展數(shù)據(jù)胖缤。

三個必須的列: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.

關(guān)于染色體的起始位置和終止位置的坐標(biāo)計(jì)數(shù),The UCSC Genome Browser Coordinate Counting Systems有更多的解釋淤刃。畫的圖很容易懂摸恍,用手指就可以領(lǐng)會砸逊。

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- 在基因組瀏覽器中顯示的灰度設(shè)定篓像,值介于0-1000动知;

strand- 正負(fù)鏈標(biāo)記. 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)值员辩,當(dāng)itemRgb設(shè)置為 "On"盒粮,BED的行會顯示顏色.

blockCount- blocks (exons外顯子)數(shù)目.

blockSizes- blocks (exons)大小列表,逗號分隔奠滑,對應(yīng)于blockCount.


blockStarts-blocks (exons)起始位置列表丹皱,逗號分隔,對應(yīng)于blockCount.宋税;這個起始位置是與chromStart的一個相對位置摊崭。

BED文件

如果看到bed后面有數(shù)字,比如說BED3或者BED4杰赛,數(shù)字代表的可能是列數(shù)呢簸。

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文件的內(nèi)容

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文件的格式

在生物信息學(xué)中,F(xiàn)ASTA格式(又稱為Pearson格式)是一種基于文本的、用于表示核苷酸序列或氨基酸序列的格式唱较。在這種格式中堿基對或氨基酸用單個字母來表示扎唾,且允許在序列前添加序列名及注釋。

FASTA文件以序列表示和序列作為一個基本單元南缓,各行記錄信息如下:

第一行是由大于號">"開頭的任意文字說明胸遇,用于序列標(biāo)記,為了保證后續(xù)分析軟件能夠區(qū)分每條序列汉形,單個序列的標(biāo)識必須具有唯一性纸镊。;

從第二行開始為序列本身概疆,只允許使用既定的核苷酸或氨基酸編碼符號逗威。通常核苷酸符號大小寫均可,而氨基酸常用大寫字母岔冀。使用時應(yīng)注意有些程序?qū)Υ笮懹忻鞔_要求凯旭。文件每行的字母一般不應(yīng)超過80個字符。

2使套、FASTQ文件格式

FASTQ是基于文本的罐呼、保存核酸序列和其測序質(zhì)量信息的標(biāo)準(zhǔn)格式。其序列以及質(zhì)量信息都是使用一個ASCII字符標(biāo)示侦高,最初由Sanger開發(fā)嫉柴,目的是將FASTA序列與質(zhì)量數(shù)據(jù)放到一起,目前已經(jīng)成為高通量測序結(jié)果的事實(shí)標(biāo)準(zhǔn)矫膨。

FASTQ文件中以四行最為一個基本單元差凹,并對應(yīng)一條序列的測序信息,各行記錄信息如下:

第一行記錄序列標(biāo)識以及相關(guān)的描述信息侧馅,以‘@’開頭危尿,為了保證后續(xù)分析軟件能夠區(qū)分每條序列,單個序列的標(biāo)識必須具有唯一性馁痴;

第二行為堿基序列谊娇;

第三行以‘+’開頭,后面是序列標(biāo)示符罗晕、描述信息济欢,或者什么也不加;

第四行小渊,是質(zhì)量信息法褥,長度和第二行的序列相對應(yīng),每一個序列都有一個質(zhì)量評分酬屉,根據(jù)評分體系的不同半等,每個字符的含義表示的數(shù)字也不相同揍愁。

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之后,基本處理就是排序赌躺,格式轉(zhuǎn)換狼牺,建立索引。

在bismark中有一個對基因組建立索引的步驟礼患,但是我也不知道為什么要建立這個索引以及這個索引可以用來干什么是钥。可能是為了提高比對的速度缅叠。留坑悄泥。

建立索引

#這里的bt2結(jié)尾的文件就是索引,是二進(jìn)制文件肤粱。

(1)Convert SAM to BAM using the samtools program:#將SAM文件轉(zhuǎn)換為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為后綴的文件基因組坐標(biāo)可以快速在BAM文件中轉(zhuǎn)換為文件偏移量。(看不太懂)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末领曼,一起剝皮案震驚了整個濱河市鸥鹉,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌庶骄,老刑警劉巖毁渗,帶你破解...
    沈念sama閱讀 216,372評論 6 498
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異单刁,居然都是意外死亡灸异,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,368評論 3 392
  • 文/潘曉璐 我一進(jìn)店門羔飞,熙熙樓的掌柜王于貴愁眉苦臉地迎上來肺樟,“玉大人,你說我怎么就攤上這事逻淌∶床” “怎么了?”我有些...
    開封第一講書人閱讀 162,415評論 0 353
  • 文/不壞的土叔 我叫張陵卡儒,是天一觀的道長蹦狂。 經(jīng)常有香客問我誓篱,道長,這世上最難降的妖魔是什么凯楔? 我笑而不...
    開封第一講書人閱讀 58,157評論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮锦募,結(jié)果婚禮上摆屯,老公的妹妹穿的比我還像新娘。我一直安慰自己糠亩,他們只是感情好虐骑,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,171評論 6 388
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著赎线,像睡著了一般廷没。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上垂寥,一...
    開封第一講書人閱讀 51,125評論 1 297
  • 那天颠黎,我揣著相機(jī)與錄音,去河邊找鬼滞项。 笑死狭归,一個胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的文判。 我是一名探鬼主播过椎,決...
    沈念sama閱讀 40,028評論 3 417
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼戏仓!你這毒婦竟也來了疚宇?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 38,887評論 0 274
  • 序言:老撾萬榮一對情侶失蹤赏殃,失蹤者是張志新(化名)和其女友劉穎敷待,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體嗓奢,經(jīng)...
    沈念sama閱讀 45,310評論 1 310
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡讼撒,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,533評論 2 332
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了股耽。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片根盒。...
    茶點(diǎn)故事閱讀 39,690評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖物蝙,靈堂內(nèi)的尸體忽然破棺而出炎滞,到底是詐尸還是另有隱情,我是刑警寧澤诬乞,帶...
    沈念sama閱讀 35,411評論 5 343
  • 正文 年R本政府宣布册赛,位于F島的核電站钠导,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏森瘪。R本人自食惡果不足惜牡属,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,004評論 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望扼睬。 院中可真熱鬧逮栅,春花似錦、人聲如沸窗宇。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,659評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽军俊。三九已至侥加,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間粪躬,已是汗流浹背担败。 一陣腳步聲響...
    開封第一講書人閱讀 32,812評論 1 268
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留短蜕,地道東北人氢架。 一個月前我還...
    沈念sama閱讀 47,693評論 2 368
  • 正文 我出身青樓,卻偏偏與公主長得像朋魔,于是被迫代替她去往敵國和親岖研。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,577評論 2 353

推薦閱讀更多精彩內(nèi)容