python script revision for sequencing depth
1
0
Entering edit mode
20 months ago
hellokwmin • 0

Hello,

After calculation of sequencing depth using samtools, I am trying to print out the result of sequencing depth using python script. But, I would like to make a limitation for y-axis to be "200".

The python script I am using as follosw: Probably, I need to revise one that I make a bold. Please, help me.

--script ----

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import sys


input_data = sys.argv[1]
output_data = sys.argv[2]
column_names 
data = pd.read_csv(input_data, sep='\t', header=None, names=column_names)


x = data['基因组位置']
y = data['覆盖深度']

# ************
average_coverage_depth = y.mean()
maximal_depth = y.max()
minimal_depth = y.min()
total_genome_length = x.iloc[-1]
# ************


plt.figure(figsize=(12, 6))
plt.plot(x, y, color='blue', linewidth=1, linestyle='-')


plt.title('Sequencing Depth and Coverage Map', fontsize=18, pad=20)
plt.xlabel('Genomic Position (bp)', fontsize=14)
plt.ylabel('Sequencing Depth (×)', fontsize=14)

plt.xticks(fontsize=12)
plt.yticks(fontsize=12)

plt.grid(True, linestyle='--', alpha=0.5)
script sequencing depth python range • 636 views
ADD COMMENT
0
Entering edit mode
20 months ago
Shred ★ 1.6k

Literally the first search result

plt.ylim(0,200)
ADD COMMENT

Login before adding your answer.

Traffic: 2106 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6