해당 내용은 QIIME 2 Tutorial을 바탕으로 작성된 글로, Reference의 URL에서 원본 내용을 확인할 수 있습니다.
Python에서 QIIME을 import하여 paired-end reads를 deblur로 분석하는 방법을 알아보겠다.
해당 튜토리얼을 command line에서가 아니라 python 환경에서 실행하였다.
QIIME2가 설치된 conda 가상환경에서 Jupyter lab을 실행하여 수행함.
코드
! wget \
-O "demux.qza" \
"https://data.qiime2.org/2021.2/tutorials/read-joining/atacama-seqs.qza"
# Joining reads
from qiime2.plugins.vsearch.methods import join_pairs
from qiime2 import Artifact
demux=Artifact.load('demux.qza') # SampleData[PairedEndSequencesWithQuality]
demuxJoinedResults = join_pairs(demultiplexed_seqs=demux)
# Viewing a summary of joined data with read quality
from qiime2.plugins.demux.visualizers import summarize
demuxJoinedVisResults = summarize(data=demuxJoinedResults.joined_sequences)
demuxJoinedVisResults.visualization.save("demuxJoined.qzv")
# Sequence quality control
# "The parameters to this method have not been extensively benchmarked on joined read data, so we recommend experimenting with different parameter settings.
from qiime2.plugins.quality_filter.methods import q_score
qScoreResults=q_score(demux=demuxJoinedResults.joined_sequences)
filteredSequences=qScoreResults.filtered_sequences
filterStats=qScoreResults.filter_stats
# Deblur
from qiime2.plugins.deblur.methods import denoise_16S
denoiseResults=denoise_16S(demultiplexed_seqs=filteredSequences, trim_length=250, sample_stats=True)
repSeqs = denoiseResults.representative_sequences
table = denoiseResults.table
deblurStats = denoiseResults.stats
# View summary of Deblur feature table
from qiime2.plugins.feature_table.visualizers import summarize
summarize(table = table).visualization.save("table.qzv")
Reference
728x90
반응형
'Bioinformatics > Metagenomics' 카테고리의 다른 글
[QIIME2] QIIME과 관련된 Data resources (0) | 2021.03.31 |
---|---|
[QIIME2] Training feature classifiers with q2-feature-classifier 튜토리얼 (0) | 2021.03.30 |
[QIIME2] QIIME의 3가지 Interface (CLI, GUI, Python API) (0) | 2021.03.05 |
[QIIME2] Data Importing (to QIIME2 ARTIFACT) 및 Exporting (from QIIME2 ARTIFACT) (0) | 2021.03.05 |
[QIIME2] Atacama soil microbiome 튜토리얼 (0) | 2021.03.04 |