## conda install -c bioconda igvtools
## conda install -c bioconda igv
## conda install -c bioconda samtools
## http://kazumaxneo.hatenablog.com/entry/2017/07/05/132019
import os
import re
species = 'hg38'
annotation_file = species+'.gtf'
annotation = os.path.join('/Users/user/ws/ref/annotation',annotation_file)
genome_dir = '/Users/user/ws/ref/genome/'
genomeFastaFile = os.path.join(genome_dir,species+'.fa')
root_dir = '/Users/user/Downloads/test_igv/output'
igv_dir = os.path.join(root_dir,'igv_dir')
bed_file = 'your_bedfile_name'
bedFile = os.path.join(igv_dir,bed_file+'.bed')
cmd = 'sed -e "s/\$/.Aligned.out.sorted.bam/" -e "s/^/\/Users\/user\/Downloads\/test_igv\/output\/igv_dir\//" %s/SRR_Acc_List.txt > %s/bamSortFile_List.txt ' % (root_dir,igv_dir)
os.system(cmd)
file = open(os.path.join(igv_dir,'bamSortFile_List.txt'),'r')
samplename = file.read().split()
filename = ' '.join(samplename)
print(filename)
cmd = 'igv -g %s %s %s %s' % (genomeFastaFile,annotation,bedFile,filename[0:])
print(cmd)
os.system(cmd)
# An index file for /Users/petadimensionlab/ws/ref/annotation/saimiri_ensembl.gtf could not be located. An index is recommended to view files of this size. Click "Go" to create one now or "Cancel to proceed without an index.
# > click "Go"
# F iles must be sorted by start position prior to indexing. Input file is not sorted by start position. We saw a record with a start of JH378105:25250124 after a record with a start of JH378105:25250172, for input source: /Users/petadimensionlab/ws/ref/annotation/saimiri_ensembl.gtf Note: igvtools can be used to sort the file, select "File > Run igvtools...".
# > click "OK"
memo:
下記コマンドに関していい方法が思い浮かびませんでした・・・
→bamファイル(sort、index後の)のディレクトリ名のリストファイルを作成するコマンドです。
cmd = 'sed -e "s/$/.Aligned.out.sorted.bam/" -e "s/^//Users/user/Downloads/test_igv/output/igv_dir//" %s/SRR_Acc_List.txt > %s/bamSortFile_List.txt ' % (root_dir,igv_dir)
os.system(cmd)
memo(重要):
こちらのコマンドはbamファイル・genomeファイル・bamファイルを指定し、IGVを起動するだけのスクリプトです。
イメージの保存は手でポチポチしないといけません!!!
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing