Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed cgi-bin/data/RAM/SRR1260032/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/RAM/SRR1260033/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/RAM/SRR1261509/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/SAM/SRR949956/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/SAM/SRR949965/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/SAM/SRR949988/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/SAM/SRR949989/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/aerial/ERR274310/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/aerial/SRR547531/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/aerial/SRR548277/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/aerial/SRR847503/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/aerial/SRR847504/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/aerial/SRR847505/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/aerial/SRR847506/accepted_hits.bam.bai
Binary file not shown.
344 changes: 172 additions & 172 deletions cgi-bin/data/bamdata_Developmental_transcriptome.xml

Large diffs are not rendered by default.

226 changes: 113 additions & 113 deletions cgi-bin/data/bamdata_araport11.xml

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file removed cgi-bin/data/dark/SRR1019436/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/dark/SRR1019437/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/dark/SRR1049784/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/dark/SRR477075/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/dark/SRR477076/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/dark/SRR493237/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/dark/SRR493238/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/flower/SRR314815/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/flower/SRR800753/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/flower/SRR800754/accepted_hits.bam.bai
Binary file not shown.
84 changes: 42 additions & 42 deletions cgi-bin/data/guard_cell_drought.xml

Large diffs are not rendered by default.

Binary file removed cgi-bin/data/leaf/SRR1105822/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR1105823/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR1159821/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR1159827/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR1159837/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR314813/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR446027/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR446028/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR446033/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR446034/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR446039/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR446040/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR446484/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR446485/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR446486/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR446487/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR493036/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR493097/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR493098/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR493101/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR764885/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR924656/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR934391/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/leaf/SRR942022/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR070570/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR070571/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR1001909/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR1001910/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR1019221/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR345561/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR345562/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR346552/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR346553/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR394082/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR504179/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR504180/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR504181/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR515073/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR515074/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR527164/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR527165/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR584115/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR584121/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR584129/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR584134/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653555/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653556/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653557/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653561/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653562/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653563/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653564/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653565/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653566/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653567/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653568/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653569/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653570/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653571/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653572/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653573/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653574/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653575/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653576/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653577/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR653578/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR797194/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR797230/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/light/SRR833246/accepted_hits.bam.bai
Binary file not shown.
60 changes: 30 additions & 30 deletions cgi-bin/data/pollen.xml

Large diffs are not rendered by default.

Binary file removed cgi-bin/data/pollen/SRR847501/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/pollen/SRR847502/accepted_hits.bam.bai
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed cgi-bin/data/root/ERR274309/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/root/SRR1046909/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/root/SRR1046910/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/root/SRR1524935/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/root/SRR1524938/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/root/SRR1524940/accepted_hits.bam.bai
Binary file not shown.
Binary file removed cgi-bin/data/root/SRR314814/accepted_hits.bam.bai
Binary file not shown.
185 changes: 22 additions & 163 deletions cgi-bin/rnaSeqMapCoverage.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,8 @@ def determineReadMapNumber(filedir, filename, readMappedNumber, remoteDrive, bam
readsMappedHold = [] # Holds the number

# Clear temporary files and name a new one
os.system("find ../temp/* -mtime +1 -exec rm -f {} \\;")
os.system("find /var/www/html/eFP-Seq_Browser/temp/* -mtime +1 -exec rm -f {} \\;")

# Set the environment
bai_directory = ("data/" + filedir)
if os.path.isdir(bai_directory):
os.chdir(bai_directory)
else:
os.makedirs(bai_directory)
os.chdir(bai_directory)
my_env = os.environ.copy()
my_env["LD_LIBRARY_PATH"] = "/usr/local/lib/"

Expand All @@ -126,8 +119,6 @@ def determineReadMapNumber(filedir, filename, readMappedNumber, remoteDrive, bam
except:
pass

os.chdir("../../../")

if flagstat is None:
return "FAILED: determineReadMapNumber-flagstat NONE"

Expand All @@ -152,21 +143,10 @@ def makeImage(filedir, filename, chromosome, start, end, record, yscale, hexcode
x_bp_vals = [] # Holds nucleotide positions...
y_reads_values = [] # Holds the valid mapped reads for the position...

if bamType == "Google Drive":
# Clear temporary files and name a new one
# os.system("find ../temp/* -mtime +1 -exec rm -f {} \\;")
tempfile = "../temp/RNASeqGraph.png"

# Call samtools and get mpileup
region = chromosome + ":" + str(start) + "-" + str(end)

# Set the environment
bai_directory = ("data/" + filedir)
if os.path.isdir(bai_directory):
os.chdir(bai_directory)
else:
os.makedirs(bai_directory)
os.chdir(bai_directory)
my_env = os.environ.copy()
my_env["LD_LIBRARY_PATH"] = "/usr/local/lib/"

Expand All @@ -178,8 +158,6 @@ def makeImage(filedir, filename, chromosome, start, end, record, yscale, hexcode
except:
pass

os.chdir("../../../")

if mpileup is None:
return "FAILED"

Expand Down Expand Up @@ -247,9 +225,9 @@ def makeImage(filedir, filename, chromosome, start, end, record, yscale, hexcode

if bamType == "Amazon AWS":
# Clear temporary files and name a new one
os.system("find ../temp/* -mtime +1 -exec rm -f {} \\;")
os.system("find /var/www/html/eFP-Seq_Browser/temp/* -mtime +1 -exec rm -f {} \\;")

tempfile = "../temp/RNASeqGraph.png"
tempfile = "/var/www/html/eFP-Seq_Browser/temp/RNASeqGraph.png"
# Output the GD image to temp PNG file
f = open(tempfile, "wb")
rnaseq_graph_image.save(f)
Expand All @@ -263,7 +241,7 @@ def makeImage(filedir, filename, chromosome, start, end, record, yscale, hexcode


################################################################################
# Ouput functions
# Output functions
################################################################################
# Error function
def dumpError(result, locus=None, record=None, my_base64img=None, abs_fpkm=None, r=None, totalReadsMapped=None):
Expand Down Expand Up @@ -401,63 +379,16 @@ def main():
expectedGeneLength.append(exonGeneLength)

# Public datasets and their directories:
# There are no public record as of Sep 2025
publicDatapoints = {
'aerial': ['ERR274310', 'SRR547531', 'SRR548277', 'SRR847503', 'SRR847504', 'SRR847505', 'SRR847506'],
'carpel': ['SRR1207194', 'SRR1207195'],
'dark': ['SRR1019436', 'SRR1019437', 'SRR1049784', 'SRR477075', 'SRR477076', 'SRR493237', 'SRR493238'],
'flower': ['SRR314815', 'SRR800753', 'SRR800754'],
'Klepikova': ['SRR3581336', 'SRR3581345', 'SRR3581346', 'SRR3581347', 'SRR3581352', 'SRR3581356',
'SRR3581383', 'SRR3581388', 'SRR3581499', 'SRR3581591', 'SRR3581639', 'SRR3581672',
'SRR3581676', 'SRR3581678', 'SRR3581679', 'SRR3581680', 'SRR3581681', 'SRR3581682',
'SRR3581683', 'SRR3581684', 'SRR3581685', 'SRR3581686', 'SRR3581687', 'SRR3581688',
'SRR3581689', 'SRR3581690', 'SRR3581691', 'SRR3581692', 'SRR3581693', 'SRR3581694',
'SRR3581695', 'SRR3581696', 'SRR3581697', 'SRR3581698', 'SRR3581699', 'SRR3581700',
'SRR3581701', 'SRR3581702', 'SRR3581703', 'SRR3581704', 'SRR3581705', 'SRR3581706',
'SRR3581707', 'SRR3581708', 'SRR3581709', 'SRR3581710', 'SRR3581711', 'SRR3581712',
'SRR3581713', 'SRR3581714', 'SRR3581715', 'SRR3581716', 'SRR3581717', 'SRR3581719',
'SRR3581720', 'SRR3581721', 'SRR3581724', 'SRR3581726', 'SRR3581727', 'SRR3581728',
'SRR3581730', 'SRR3581731', 'SRR3581732', 'SRR3581733', 'SRR3581734', 'SRR3581735',
'SRR3581736', 'SRR3581737', 'SRR3581738', 'SRR3581740', 'SRR3581831', 'SRR3581833',
'SRR3581834', 'SRR3581835', 'SRR3581836', 'SRR3581837', 'SRR3581838', 'SRR3581839',
'SRR3581840', 'SRR3581841', 'SRR3581842', 'SRR3581843', 'SRR3581844', 'SRR3581845',
'SRR3581846', 'SRR3581847', 'SRR3581848', 'SRR3581849', 'SRR3581850', 'SRR3581851',
'SRR3581852', 'SRR3581853', 'SRR3581854', 'SRR3581855', 'SRR3581856', 'SRR3581857',
'SRR3581858', 'SRR3581859', 'SRR3581860', 'SRR3581861', 'SRR3581862', 'SRR3581863',
'SRR3581864', 'SRR3581865', 'SRR3581866', 'SRR3581867', 'SRR3581868', 'SRR3581869',
'SRR3581870', 'SRR3581871', 'SRR3581872', 'SRR3581873', 'SRR3581874', 'SRR3581875',
'SRR3581876', 'SRR3581877', 'SRR3581878', 'SRR3581879', 'SRR3581880', 'SRR3581881',
'SRR3581882', 'SRR3581883', 'SRR3581884', 'SRR3581885', 'SRR3581886', 'SRR3581887',
'SRR3581888', 'SRR3581889', 'SRR3581890', 'SRR3581891', 'SRR3581892', 'SRR3581893',
'SRR3581894', 'SRR3581895', 'SRR3581896', 'SRR3581897', 'SRR3581898', 'SRR3581899',
'SRR3724649', 'SRR3724650', 'SRR3724651', 'SRR3724652', 'SRR3724663', 'SRR3724668',
'SRR3724737', 'SRR3724739', 'SRR3724741', 'SRR3724768', 'SRR3724774', 'SRR3724778',
'SRR3724782', 'SRR3724785', 'SRR3724786', 'SRR3724787', 'SRR3724798', 'SRR3724806',
'SRR3724814', 'SRR3725446', 'SRR3725458', 'SRR3725471', 'SRR3725482', 'SRR3725493',
'SRR3725503', 'SRR3725516', 'SRR3725527', 'SRR3725538', 'SRR3725550', 'SRR3725561',
'SRR847501', 'SRR847502'],
'leaf': ['SRR1105822', 'SRR1105823', 'SRR1159821', 'SRR1159827', 'SRR1159837', 'SRR314813', 'SRR446027',
'SRR446028', 'SRR446033', 'SRR446034', 'SRR446039', 'SRR446040', 'SRR446484', 'SRR446485',
'SRR446486', 'SRR446487', 'SRR493036', 'SRR493097', 'SRR493098', 'SRR493101', 'SRR764885',
'SRR924656', 'SRR934391', 'SRR942022'],
'light': ['SRR070570', 'SRR070571', 'SRR1001909', 'SRR1001910', 'SRR1019221', 'SRR345561', 'SRR345562',
'SRR346552', 'SRR346553', 'SRR394082', 'SRR504179', 'SRR504180', 'SRR504181', 'SRR515073',
'SRR515074', 'SRR527164', 'SRR527165', 'SRR584115', 'SRR584121', 'SRR584129', 'SRR584134',
'SRR653555', 'SRR653556', 'SRR653557', 'SRR653561', 'SRR653562', 'SRR653563', 'SRR653564',
'SRR653565', 'SRR653566', 'SRR653567', 'SRR653568', 'SRR653569', 'SRR653570', 'SRR653571',
'SRR653572', 'SRR653573', 'SRR653574', 'SRR653575', 'SRR653576', 'SRR653577', 'SRR653578',
'SRR797194', 'SRR797230', 'SRR833246'],
'pollen': ['SRR847501', 'SRR847502'],
'RAM': ['SRR1260032', 'SRR1260033', 'SRR1261509'],
'receptacle': ['SRR401413', 'SRR401414', 'SRR401415', 'SRR401416', 'SRR401417', 'SRR401418', 'SRR401419',
'SRR401420', 'SRR401421'],
'root': ['ERR274309', 'SRR1046909', 'SRR1046910', 'SRR1524935', 'SRR1524938', 'SRR1524940', 'SRR314814'],
'SAM': ['SRR949956', 'SRR949965', 'SRR949988', 'SRR949989']

}

### Generate BAM directory link
bam_dir = '' # Reset bam_dir value
# Check if data is public or private dataset
if cachedDatapoints:
# This won't work after Sep 2025
for x in publicDatapoints: # If public, find tissue (x) to create bam_dir
if record in publicDatapoints[x]:
bam_dir = x + '/' + record
Expand All @@ -472,80 +403,25 @@ def main():
else:
bam_dir = "uploads" + "/unknownRecord_" + start_time

# Google Drive and Amazon AWS not longer works!
bam_file = '' # Reset bam_file value
if bamType == "Google Drive":
# Create a Google Drive mount point and muont the bam file.
uniqId = str(random.randint(1, 1000000))
try:
pid = subprocess.Popen(["perl", "gDriveMountFast.pl", remoteDrive, uniqId, bamfilename])
except:
sys.exit(1)

# Make S3FS filename here
bam_file = "/mnt/gDrive/" + remoteDrive + "_" + uniqId + "/" + bamfilename

# Wait unilt the file is ready, without locking up the system forever, locking system for five minutes
startTime = time.time()
while not (os.path.isfile(bam_file)):
# pass
currentTime = time.time()
if currentTime > (startTime + 300):
subprocess.call(["fusermount", "-u", "/mnt/gDrive/" + remoteDrive + "_" + uniqId])
subprocess.call(["rm", "-rf", "/mnt/gDrive/" + remoteDrive + "_" + uniqId])
dumpError("Mounting timed out", locus, record, base64img, abs_fpkm, r, totalReadsMapped)

# Now make a image using samtools
base64img = makeImage(bam_dir, bam_file, "Chr" + chromosome, start, end, record, yscale, hexcode,
remoteDrive, bamType)

if base64img == "FAILED":
base64img = makeImage(bam_dir, bam_file, "chr" + chromosome, start, end, record, yscale, hexcode,
remoteDrive, bamType)
region = "chr" + str(chromosome) + ":" + str(start) + "-" + str(end)

if base64img == "FAILED":
base64img = makeImage(bam_dir, bam_file, chromosome, start, end, record, yscale, hexcode, remoteDrive,
bamType)

if base64img == "FAILED":
subprocess.call(["fusermount", "-u", "/mnt/gDrive/" + remoteDrive + "_" + uniqId])
subprocess.call(["rm", "-rf", "/mnt/gDrive/" + remoteDrive + "_" + uniqId])
dumpError("Failed to get data.", locus, record, base64img, abs_fpkm, r, totalReadsMapped)

elif bamType == "Amazon AWS":
# Make S3FS filename here
bam_file = "s3://" + remoteDrive

# Now make a image using samtools
base64img = makeImage(bam_dir, bam_file, "Chr" + chromosome, start, end, record, yscale, hexcode,
remoteDrive, bamType)

if base64img == "FAILED":
base64img = makeImage(bam_dir, bam_file, "chr" + chromosome, start, end, record, yscale, hexcode,
remoteDrive, bamType)
region = "chr" + str(chromosome) + ":" + str(start) + "-" + str(end)
# Local
bam_file = remoteDrive

if base64img == "FAILED":
region = str(chromosome) + ":" + str(start) + "-" + str(end)
base64img = makeImage(bam_dir, bam_file, chromosome, start, end, record, yscale, hexcode, remoteDrive,
bamType)
# Now make an image using samtools
base64img = makeImage(bam_dir, bam_file, "Chr" + chromosome, start, end, record, yscale, hexcode,
remoteDrive, bamType)

else:
# Local
bam_file = remoteDrive

# Now make an image using samtools
base64img = makeImage(bam_dir, bam_file, "Chr" + chromosome, start, end, record, yscale, hexcode,
if base64img == "FAILED":
base64img = makeImage(bam_dir, bam_file, "chr" + chromosome, start, end, record, yscale, hexcode,
remoteDrive, bamType)
region = "chr" + str(chromosome) + ":" + str(start) + "-" + str(end)

if base64img == "FAILED":
base64img = makeImage(bam_dir, bam_file, "chr" + chromosome, start, end, record, yscale, hexcode,
remoteDrive, bamType)
region = "chr" + str(chromosome) + ":" + str(start) + "-" + str(end)

if base64img == "FAILED":
region = str(chromosome) + ":" + str(start) + "-" + str(end)
base64img = makeImage(bam_dir, bam_file, chromosome, start, end, record, yscale, hexcode, remoteDrive,
if base64img == "FAILED":
region = str(chromosome) + ":" + str(start) + "-" + str(end)
base64img = makeImage(bam_dir, bam_file, chromosome, start, end, record, yscale, hexcode, remoteDrive,
bamType)

# Correct total reads mapped:
Expand Down Expand Up @@ -607,12 +483,6 @@ def main():
# the same info would be there. So just pass that along instead of
# making this call .. to speed things up
# Set the environment
bai_directory = ("data/" + bam_dir)
if os.path.isdir(bai_directory):
os.chdir(bai_directory)
else:
os.makedirs(bai_directory)
os.chdir(bai_directory)
my_env = os.environ
my_env["LD_LIBRARY_PATH"] = "/usr/local/lib/"

Expand All @@ -623,12 +493,11 @@ def main():
except:
dumpError("Unable to retrieve BAM data", locus, record, base64img, abs_fpkm, r, totalReadsMapped)

os.chdir("../../../")

# Change this if FPKM is wrong for local data
if bamType == "local":
mapped_reads = lines.lower().count("\t" + chromosome + "\t")
else:
# Sep 2025
mapped_reads = lines.lower().count("\t" + chromosome + "\t")
if mapped_reads == 0:
mapped_reads = lines.lower().count('chr')

abs_fpkm = []
Expand All @@ -647,16 +516,6 @@ def main():
r_val = float(sp / (math.sqrt(ss_x[i] * ss_y)))
r.append(round(r_val, PRECISION))

if bamType == "Google Drive":
try:
subprocess.call(["fusermount", "-u", "/mnt/gDrive/" + remoteDrive + "_" + uniqId])
except:
sys.stderr.write("Failed to unmount FUSE file system.")

try:
subprocess.call(["rm", "-rf", "/mnt/gDrive/" + remoteDrive + "_" + uniqId])
except:
sys.stderr.write("Failed to delete FUSE mount point.")

RNASeq_ReadsPerNucleotide = base64img[1]

Expand Down