root/galaxy-central/tools/samtools/sam_bitwise_flag_filter.xml @ 3

リビジョン 2, 3.9 KB (コミッタ: hatakeyama, 14 年 前)

import galaxy-central

行番号 
1<tool id="sam_bw_filter" name="Filter SAM" version="1.0.0">
2  <description>on bitwise flag values</description>
3  <command interpreter="python">
4    sam_bitwise_flag_filter.py 
5      --input_sam_file=$input1
6      --flag_column=2
7      #for $bit in $bits
8       '${bit.flags}=${bit.states}'
9      #end for
10      > $out_file1
11  </command>
12  <inputs>
13    <param format="sam" name="input1" type="data" label="Select dataset to filter"/>
14    <repeat name="bits" title="Flag">
15      <param name="flags" type="select" label="Type">
16        <option value="--0x0001">Read is paired</option>
17        <option value="--0x0002">Read is mapped in a proper pair</option>
18        <option value="--0x0004">The read is unmapped</option>
19        <option value="--0x0008">The mate is unmapped</option>
20        <option value="--0x0010">Read strand</option>
21        <option value="--0x0020">Mate strand</option>
22        <option value="--0x0040">Read is the first in a pair</option>
23        <option value="--0x0080">Read is the second in a pair</option>
24        <option value="--0x0100">The alignment or this read is not primary</option>
25        <option value="--0x0200">The read fails platform/vendor quality checks</option>
26        <option value="--0x0400">The read is a PCR or optical duplicate</option>
27      </param>
28      <param name="states" type="select" display="radio" label="Set the states for this flag">
29         <option value="0">No</option>
30         <option value="1">Yes</option>
31       </param>
32    </repeat>
33  </inputs>
34  <outputs>
35    <data format="sam" name="out_file1" />
36  </outputs>
37  <tests>
38    <test>
39      <param name="input1" value="sam_bw_filter.sam" ftype="sam"/>
40      <param name="flags" value="Read is mapped in a proper pair"/>
41      <param name="states" value="1"/>
42      <output name="out_file1" file="sam_bw_filter_0002-yes.sam" ftype="sam"/>
43    </test>
44  </tests>
45  <help>
46
47**What it does**
48
49Allows parsing of SAM datasets using bitwise flag (the second column). The bits in the flag are defined as follows::
50
51    Bit Info
52 ------ --------------------------------------------------------------------------   
53 0x0001 the read is paired in sequencing, no matter whether it is mapped in a pair
54 0x0002 the read is mapped in a proper pair (depends on the protocol, normally
55        inferred during alignment) 1
56 0x0004 the query sequence itself is unmapped
57 0x0008 the mate is unmapped 1
58 0x0010 strand of the query (0 for forward; 1 for reverse strand)
59 0x0020 strand of the mate 1
60 0x0040 the read is the first read in a pair (see below)
61 0x0080 the read is the second read in a pair (see below)
62 0x0100 the alignment is not primary (a read having split hits may
63        have multiple primary alignment records)
64 0x0200 the read fails platform/vendor quality checks
65 0x0400 the read is either a PCR duplicate or an optical duplicate
66
67Note the following:
68
69- Flag 0x02, 0x08, 0x20, 0x40 and 0x80 are only meaningful when flag 0x01 is present.
70- If in a read pair the information on which read is the first in the pair is lost in the upstream analysis, flag 0x01 should be set, while 0x40 and 0x80 should both be zero.
71
72-----
73
74**Example**
75
76Suppose the following dataset was generated with BWA mapper::
77
78 r001 163 ref  7 30 8M2I4M1D3M = 37  39 TTAGATAAAGGATACTA *
79 r002   0 ref  9 30 3S6M1P1I4M *  0   0 AAAAGATAAGGATA    *
80 r003   0 ref  9 30       5H6M *  0   0 AGCTAA            * NM:i:1
81 r004   0 ref 16 30    6M14N5M *  0   0 ATAGCTTCAGC       *
82 r003  16 ref 29 30       6H5M *  0   0 TAGGC             * NM:i:0
83 r001  83 ref 37 30         9M =  7 -39 CAGCGCCAT         *
84
85To select properly mapped pairs, click the **Add new Flag** button and set *Read mapped in a proper pair* to **Yes**. The following two reads will be returned::
86
87 r001 163 ref  7 30 8M2I4M1D3M = 37  39 TTAGATAAAGGATACTA *
88 r001  83 ref 37 30         9M =  7 -39 CAGCGCCAT         *
89
90For more information, please consult the `SAM format description`__.
91
92.. __: http://www.ncbi.nlm.nih.gov/pubmed/19505943
93
94
95  </help>
96</tool>
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。