OSCR

Elevated intron retention implicates neuroinflammation in brains of individuals with alcohol use disorder.

Code ↔ Paper

1 match between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 1 match
  1. [1] § Materials and methods › Identification of IR events, quantification of intron content, and statistical analysis ↔ scripts/intron_calling.py, lines 62–142 · score 0.60 · HTSeq, uniquely mapped, interval, filtered, exons, events

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 496 lines · 25 KB · no license · 1 match

  1. import argparse;
  2. import os,shutil;
  3. import subprocess;
  4. import HTSeq,re,time;
  5. import collections;
  6. import pandas as pd;
  7. from multiprocessing import Pool;
  8. #
  9. parser = argparse.ArgumentParser()
  10. parser.add_argument('-b', metavar = 'input', dest='bamFile', help='Give input file fullname');
  11. parser.add_argument('-g', metavar = 'gtffile', dest='gtfFile', help='Give parsed gtf file fullname');
  12. parser.add_argument('-t', dest='thread', type=int, help='number of multiple thread number,>0');
  13. parser.add_argument('-o', metavar = 'output', dest='outputFile',help='Give output file fullname');
  14. parser.add_argument('-normal', metavar = 'common retain intron list', dest='norm_list',help='provide intron to be removed');
  15. parser.add_argument('-j', metavar = 'anchor length', type=int, dest='junction',help='Give a specific anchor length');
  16. parser.add_argument('-c', metavar = 'intronRead filter', dest='intron_read', type=int,help='Set a intron read filter');
  17. parser.add_argument('-p', metavar = 'intronPSI filter', dest='intron_psi', type=float,help='threshhold of psi value filter');
  18. parser.add_argument('-n', metavar = 'novel intron read read filter', dest='novel_read', type=int,help='Set a novel intron read filter threshhold');
  19. args = parser.parse_args();
  20. bamFile = args.bamFile;
  21. gtf = args.gtfFile;
  22. thread = args.thread;
  23. output = args.outputFile;
  24. norm_list = args.norm_list;
  25. junction = args.junction;
  26. intron_read_filter = args.intron_read;
  27. intron_psi_filter = args.intron_psi;
  28. novel_read_filter = args.novel_read;
  29. cpus= os.cpu_count();# get all available cpu counts
  30. if thread:
  31. thread=thread;
  32. thread= min(thread, cpus); # make sure the maximum thread not over available cpus!
  33. else:
  34. thread=1;
  35. if norm_list:
  36. normList=[line.strip() for line in open(norm_list, 'r')]; # read from provided remove list
  37. else:
  38. normList=[];
  39. if junction: # the anchor length setting
  40. junction= junction;
  41. else:
  42. junction= 10;
  43. if intron_read_filter: # the reads fall in intron region filter
  44. intron_read_filter = intron_read_filter;
  45. else:
  46. intron_read_filter = 10;
  47. if intron_psi_filter: # percentage of intron retained rate!
  48. intron_psi_filter = intron_psi_filter;
  49. else:
  50. intron_psi_filter = 0.05;
  51. if novel_read_filter: # the anchor length setting
  52. novel_read_filter = novel_read_filter;
  53. else:
  54. novel_read_filter= 15;
  55. #
  56. #
  57. def no_parallel_run():
  58. global features;
  59. global bamfile;
  60. counts = collections.Counter()
  61. bam = HTSeq.BAM_Reader(bamfile)
  62. for read in bam:
  63. #filter1, uniq mapp filter:the option as NM/NH/CC/CP/HI
  64. NH_list= [x for x in read.optional_fields if x[0]=='NH'];
  65. if len(NH_list)==0:
  66. NH_value= 10; # if not NH tag find assign as 10;
  67. elif len(NH_list)==1:
  68. NH_value = NH_list[0][1];
  69. if NH_value == 1 or read.aQual>=30: #filter1, uniq mapp filter
  70. cigar_list= [cstring.type for cstring in read.cigar]
  71. cigar_check= [e for e in cigar_list if e in ['D','I','S','H','P','X','=' ]];
  72. if len(cigar_check)==0:
  73. counts['uniq_mapped_read'] += 1;#count every unique mapped read for calculate rpkm value
  74. if cigar_list.count('N') ==0:# call directly
  75. gene_ids = []; iv_lens=[]
  76. for iv, val in features[ read.iv ].steps():
  77. if len(val) ==1:
  78. gene_ids.append(list(val)[0]);
  79. ivList= re.split('[:[,)/]',str(iv));
  80. iv_lens.append(str(int(ivList[3]) - int(ivList[2])))
  81. if len(gene_ids)>0 and len(set([x[:15] for x in gene_ids]))==1: # remove ambigous mapped read-map to two diff genes
  82. if len(gene_ids)==1:
  83. gene_id = gene_ids[0];
  84. counts[gene_id] += 1;
  85. elif len(gene_ids)>1: #strict the intron at least have length large than anchor
  86. for g in range(len(gene_ids)):
  87. gene_id = gene_ids[g];
  88. iv_len = int(iv_lens[g]);
  89. geneInfo = re.split('-|@', gene_id)[1]
  90. if(int(geneInfo)%2==1):
  91. counts[gene_id] += 1;
  92. elif (int(geneInfo)%2==0) and (iv_len > junction):
  93. counts[gene_id] += 1;
  94. elif cigar_list.count('N') ==1:
  95. gene_ids = []; iv_lens=[]
  96. for cigop in read.cigar:
  97. if cigop.type == "M":
  98. for iv, val in features[cigop.ref_iv].steps():
  99. if len(val) ==1:
  100. gene_ids.append(list(val)[0]);
  101. ivList= re.split('[:[,)/]',str(iv));
  102. iv_lens.append(str(int(ivList[3]) - int(ivList[2])))
  103. if len(set([x[:15] for x in gene_ids]))==1: # remove ambigous mapped read-map to two diff genes
  104. # get two terminal end of skip region
  105. if len(gene_ids)>1:
  106. skip_iv= re.split('[:[,)/]',str(read.cigar[1].ref_iv));
  107. new_query= HTSeq.GenomicInterval(skip_iv[0], int(skip_iv[2])-2,int(skip_iv[3])+3, skip_iv[5]); # make sure the enlarged map window to clarify the mapping region/s!
  108. query_ids=set()
  109. for iv, val in features[new_query].steps():
  110. query_ids |= val;
  111. if len(query_ids)>0:
  112. query_list= [int(re.split('-|@', x)[1]) for x in list(query_ids)];
  113. query_list.sort();# the mapped region list check
  114. if query_list[0]%2!=0 and query_list[-1]%2!=0:# if both end at exons
  115. for g in range(len(gene_ids)):
  116. gene_id = gene_ids[g];
  117. iv_len = int(iv_lens[g]);
  118. geneInfo = re.split('-|@', gene_id)[1]
  119. if(int(geneInfo)%2==1):
  120. counts[gene_id] += 1;
  121. elif (int(geneInfo)%2==0) and (iv_len > junction):
  122. counts[gene_id] += 1;
  123. else: # all should be add as novel intron/partial retained events
  124. novel_id= (list(query_ids)[0])[0:15] + '@' + skip_iv[0] + ':u' + skip_iv[2] + '-d' + skip_iv[3];
  125. counts[novel_id] += 1;
  126. elif len(gene_ids)==1: # if disruption occurs inner one feature
  127. skip_iv= re.split('[:[,)/]',str(read.cigar[1].ref_iv));
  128. gene_id = list(gene_ids)[0];
  129. geneInfo = re.split('-|@', gene_id)[1]
  130. if int(geneInfo)%2==0: # if read mapped within a intron, count it as novel events
  131. novel_id= gene_id[0:15] + '@' + skip_iv[0] + ':u' + skip_iv[2] + '-d' + skip_iv[3];
  132. counts[novel_id] += 1;
  133. print(time.strftime("%Y-%m-%d %H:%M:%S") + ": HTSeq count finished!")
  134. return counts
  135. def do_parallel_run(part_N):
  136. global thread;
  137. global features;
  138. global tmp_prefix;
  139. bamfile_temp= tmp_prefix + "{0:0=2d}".format(part_N) + '.bam'
  140. counts = collections.Counter()
  141. bam = HTSeq.BAM_Reader(bamfile_temp)
  142. for read in bam:
  143. #filter1, uniq mapp filter:the option as NM/NH/CC/CP/HI
  144. NH_list= [x for x in read.optional_fields if x[0]=='NH'];
  145. if len(NH_list)==0:
  146. NH_value= 10; # if not NH tag find assign as 10;
  147. elif len(NH_list)==1:
  148. NH_value = NH_list[0][1];
  149. if NH_value == 1 or read.aQual>=30: #filter1, uniq mapp filter
  150. cigar_list= [cstring.type for cstring in read.cigar]
  151. cigar_check= [e for e in cigar_list if e in ['D','I','S','H','P','X','=' ]];
  152. if len(cigar_check)==0:
  153. counts['uniq_mapped_read'] += 1;#count every unique mapped read for calculate rpkm value
  154. if cigar_list.count('N') ==0:# call directly
  155. gene_ids = []; iv_lens=[]
  156. for iv, val in features[ read.iv ].steps():
  157. if len(val) ==1:
  158. gene_ids.append(list(val)[0]);
  159. ivList= re.split('[:[,)/]',str(iv));
  160. iv_lens.append(str(int(ivList[3]) - int(ivList[2])))
  161. if len(gene_ids)>0 and len(set([x[:15] for x in gene_ids]))==1: # remove ambigous mapped read-map to two diff genes
  162. if len(gene_ids)==1:
  163. gene_id = gene_ids[0];
  164. counts[gene_id] += 1;
  165. elif len(gene_ids)>1: #strict the intron at least have length large than anchor
  166. for g in range(len(gene_ids)):
  167. gene_id = gene_ids[g];
  168. iv_len = int(iv_lens[g]);
  169. geneInfo = re.split('-|@', gene_id)[1]
  170. if(int(geneInfo)%2==1):
  171. counts[gene_id] += 1;
  172. elif (int(geneInfo)%2==0) and (iv_len > junction):
  173. counts[gene_id] += 1;
  174. elif cigar_list.count('N') ==1:
  175. gene_ids = []; iv_lens=[]
  176. for cigop in read.cigar:
  177. if cigop.type == "M":
  178. for iv, val in features[cigop.ref_iv].steps():
  179. if len(val) ==1:
  180. gene_ids.append(list(val)[0]);
  181. ivList= re.split('[:[,)/]',str(iv));
  182. iv_lens.append(str(int(ivList[3]) - int(ivList[2])))
  183. if len(set([x[:15] for x in gene_ids]))==1: # remove ambigous mapped read-map to two diff genes
  184. # get two terminal end of skip region
  185. if len(gene_ids)>1:
  186. skip_iv= re.split('[:[,)/]',str(read.cigar[1].ref_iv));
  187. new_query= HTSeq.GenomicInterval(skip_iv[0], int(skip_iv[2])-2,int(skip_iv[3])+3, skip_iv[5]); # make sure the enlarged map window to clarify the mapping region/s!
  188. query_ids=set()
  189. for iv, val in features[new_query].steps():
  190. query_ids |= val;
  191. if len(query_ids)>0:
  192. query_list= [int(re.split('-|@', x)[1]) for x in list(query_ids)];
  193. query_list.sort();# the mapped region list check
  194. if query_list[0]%2!=0 and query_list[-1]%2!=0:# if both end at exons
  195. for g in range(len(gene_ids)):
  196. gene_id = gene_ids[g];
  197. iv_len = int(iv_lens[g]);
  198. geneInfo = re.split('-|@', gene_id)[1]
  199. if(int(geneInfo)%2==1):
  200. counts[gene_id] += 1;
  201. elif (int(geneInfo)%2==0) and (iv_len > junction):
  202. counts[gene_id] += 1;
  203. else: # all should be add as novel intron/partial retained events
  204. novel_id= (list(query_ids)[0])[0:15] + '@' + skip_iv[0] + ':u' + skip_iv[2] + '-d' + skip_iv[3];
  205. counts[novel_id] += 1;
  206. elif len(gene_ids)==1: # if disruption occurs inner one feature
  207. skip_iv= re.split('[:[,)/]',str(read.cigar[1].ref_iv));
  208. gene_id = list(gene_ids)[0];
  209. geneInfo = re.split('-|@', gene_id)[1]
  210. if int(geneInfo)%2==0: # if read mapped within a intron, count it as novel events
  211. novel_id= gene_id[0:15] + '@' + skip_iv[0] + ':u' + skip_iv[2] + '-d' + skip_iv[3];
  212. counts[novel_id] += 1;
  213. print(time.strftime("%Y-%m-%d %H:%M:%S") + ": Process " + str(part_N) + " finished!")
  214. return counts
  215. def single_thread_RPKM(counter):
  216. geneSum = collections.Counter()
  217. countSets = collections.Counter()
  218. for k, v in counter.items():
  219. countSets[k] +=v;
  220. geneSum[k[:15]] +=v;
  221. del countSets["uniq_mapped_read"];
  222. keys= [key for key, value in countSets.items()];
  223. rpkm_list = [];
  224. for key in keys:
  225. value = countSets[key];
  226. list=[key, value] + [None]*10;
  227. extron_list= re.split('-|@|:|-', key);
  228. list[3] = geneSum[extron_list[0]];
  229. if len(extron_list)==5:
  230. extron_len = int(extron_list[4]) - int(extron_list[3]) + 1;
  231. list[9] = value*1000/extron_len;
  232. list[4] = round(value*(10**9)/(geneSum['uniq_mapped_rea'] * extron_len), 4);
  233. if (int(extron_list[1])%2==0):
  234. list[2] = 'intron';
  235. uExon = extron_list[0] + '-' + str(int(extron_list[1]) -1);
  236. dExon = extron_list[0] + '-' + str(int(extron_list[1]) + 1);
  237. upperExon = [[key, value] for key, value in countSets.items() if uExon in key];
  238. downExon = [[key, value] for key, value in countSets.items() if dExon in key]
  239. if len(upperExon) ==1:
  240. upperList = re.split('-|@|:|-', upperExon[0][0]);
  241. list[6] = upperExon[0][1]; list[10] = int(upperList[4])-int(upperList[3])+1;
  242. if len( downExon) == 1:
  243. downList = re.split('-|@|:|-', downExon[0][0]);
  244. list[7] = downExon[0][1]; list[11] = int(downList[4])-int(downList[3])+1;
  245. elif (int(extron_list[1])%2==1):
  246. list[2] = 'exon';
  247. elif len(extron_list)==4:
  248. list[2] = 'novel-intron';
  249. rpkm_list.append(list)
  250. return rpkm_list
  251. def do_RPKM_run(key):
  252. global geneSum;
  253. global countSets;
  254. value = countSets[key];
  255. list=[key, value] + [None]*10;
  256. extron_list= re.split('-|@|:|-', key);
  257. list[3] = geneSum[extron_list[0]];
  258. if len(extron_list)==5:
  259. extron_len = int(extron_list[4]) - int(extron_list[3]) + 1;
  260. list[9] = value*1000/extron_len;
  261. list[4] = round(value*(10**9)/(geneSum['uniq_mapped_rea'] * extron_len), 4);
  262. if (int(extron_list[1])%2==0):
  263. list[2] = 'intron';
  264. uExon = extron_list[0] + '-' + str(int(extron_list[1]) -1);
  265. dExon = extron_list[0] + '-' + str(int(extron_list[1]) + 1);
  266. upperExon = [[key, value] for key, value in countSets.items() if uExon in key];
  267. downExon = [[key, value] for key, value in countSets.items() if dExon in key]
  268. if len(upperExon) ==1:
  269. upperList = re.split('-|@|:|-', upperExon[0][0]);
  270. list[6] = upperExon[0][1]; list[10] = int(upperList[4])-int(upperList[3])+1;
  271. if len( downExon) == 1:
  272. downList = re.split('-|@|:|-', downExon[0][0]);
  273. list[7] = downExon[0][1]; list[11] = int(downList[4])-int(downList[3])+1;
  274. elif (int(extron_list[1])%2==1):
  275. list[2] = 'exon';
  276. elif len(extron_list)==4:
  277. list[2] = 'novel-intron';
  278. return list
  279. def single_thread_TPM(rpkm_list):
  280. listNum = len(rpkm_list);
  281. tpmList = [x[9] for x in rpkm_list];
  282. tpmSum = sum([x for x in tpmList if x != None]);
  283. tpm_list = [];
  284. for i in range(listNum):
  285. list_tpm = rpkm_list[i];
  286. if list_tpm[2] == 'intron':
  287. extron_list= re.split('-|@|:|-', list_tpm[0]);
  288. extron_len = int(extron_list[4]) - int(extron_list[3]) + 1;
  289. tpm_val = list_tpm[1]*(10**9)/(extron_len * tpmSum);
  290. list_tpm[5]= round(tpm_val, 4);
  291. if list_tpm[6] !=None:
  292. tpm_upper = list_tpm[6]*(10**9)/(list_tpm[10]* tpmSum);
  293. else:
  294. tpm_upper = 0;
  295. if list_tpm[7] !=None:
  296. tpm_down = list_tpm[7]*(10**9)/(list_tpm[11]* tpmSum);
  297. else:
  298. tpm_down = 0;
  299. tpm_flake=[tpm_upper, tpm_down]
  300. if sum(tpm_flake)!=0:
  301. list_tpm[8] = round(tpm_val*2/sum(tpm_flake), 3);
  302. else:
  303. list_tpm = list_tpm;
  304. tpm_list.append(list_tpm);
  305. return tpm_list
  306. def do_TPM_run(index):
  307. list_tpm = rpkm_list[index];
  308. if list_tpm[2] == 'intron':
  309. extron_list= re.split('-|@|:|-', list_tpm[0]);
  310. extron_len = int(extron_list[4]) - int(extron_list[3]) + 1;
  311. tpm_val = list_tpm[1]*(10**9)/(extron_len * tpmSum);
  312. list_tpm[5]= round(tpm_val, 4);
  313. if list_tpm[6] !=None:
  314. tpm_upper = list_tpm[6]*(10**9)/(list_tpm[10]* tpmSum);
  315. else:
  316. tpm_upper = 0;
  317. if list_tpm[7] !=None:
  318. tpm_down = list_tpm[7]*(10**9)/(list_tpm[11]* tpmSum);
  319. else:
  320. tpm_down = 0;
  321. tpm_flake=[tpm_upper, tpm_down]
  322. if sum(tpm_flake)!=0:
  323. list_tpm[8] = round(tpm_val*2/sum(tpm_flake), 3);
  324. else:
  325. list_tpm = list_tpm
  326. return list_tpm
  327. if __name__ == '__main__':
  328. global features;
  329. features = HTSeq.GenomicArrayOfSets( "auto", stranded=True )
  330. for line in open(gtf):
  331. fields = line.split( "\t" );
  332. chrom= fields[0]; start=int(fields[2]); end= int(fields[3])+1; strand=fields[4];
  333. name= fields[5].split('.')[0] + '-' + str(fields[12]) + '@' + fields[0] + ':' + str(fields[2]) + '-' + str(fields[3]);
  334. iv = HTSeq.GenomicInterval(chrom, start, end, strand)
  335. features[ iv ] += name;
  336. global bamfile;
  337. bamfile = bamFile;
  338. dir= '/'.join(bamfile.split('/')[0:-1]);
  339. s1= bamfile.split('/')[-1];
  340. sample= s1.replace('.bam', '');
  341. if output:
  342. if output[-1] =='/':
  343. output = output;
  344. else:
  345. output = output + '/'
  346. else:
  347. output = dir + '/'; # defualt located at your input bam file
  348. if thread==1:
  349. print("No parallel mode, thread =",thread)
  350. results= no_parallel_run();
  351. with open(output + sample + '_rawCount.txt', 'w') as f:
  352. for tag, count in results.items():
  353. f.write('{}\t{}\n'.format(tag, count))
  354. rpkm_list= single_thread_RPKM(results);
  355. print(time.strftime("%Y-%m-%d %H:%M:%S") + ": RPKM expression calculated!")
  356. tpm_list = single_thread_TPM(rpkm_list);
  357. print(time.strftime("%Y-%m-%d %H:%M:%S") + ": TPM and PSI calculated!")
  358. tpm_list = [x[:9] for x in tpm_list if x[2] !='exon']
  359. colname = [['id','count','feature','fullGeneCount','rpkm','tpm','uppExonCount','downExonCount','psi']];
  360. data= colname + tpm_list;
  361. data = pd.DataFrame(data[1:],columns=data[0]);
  362. data.to_csv(output + sample + '_intron_calling_Rawresult.txt', index=False, sep='\t');
  363. intron_list = [x for x in tpm_list if x[2] =='intron' and x[8]!=None and float(x[1]) >= intron_read_filter and float(x[8]) >= intron_psi_filter]
  364. # remove common retained intron list from normal samples
  365. intron_list = [x for x in intron_list if x[0] not in normList]
  366. print(time.strftime("%Y-%m-%d %H:%M:%S") + ": Filter " + str(len(normList)) + " commonly retained introns in normal tissue!")
  367. intron_list = colname + intron_list;
  368. intron_data = pd.DataFrame(intron_list[1:], columns=intron_list[0]);
  369. intron_data.to_csv(output + sample + '_intron_candidates.txt', index=False, sep='\t');
  370. novel_list = [x for x in tpm_list if x[2] =='novel-intron' and x[1] >= novel_read_filter and x[1]/x[3] > 0.001]
  371. novel_list = colname + novel_list;
  372. novel_data = pd.DataFrame(novel_list[1:], columns=novel_list[0]);
  373. novel_data.to_csv(output + sample + '_novel-intron_candidates.txt', index=False, sep='\t');
  374. print(time.strftime("%Y-%m-%d %H:%M:%S") + ": All intron-calling job done!")
  375. #
  376. else:
  377. print("thread =",thread)
  378. if not os.path.exists(dir + '/tmp_' + sample):
  379. os.makedirs(dir + '/tmp_' + sample)# create a folder for speeding calculation
  380. global tmp_prefix;
  381. tmp_prefix = dir + '/tmp_' + sample + '/tmp_'
  382. p0=subprocess.Popen("samtools view -@ " + str(thread) + " -c " + bamfile, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0];
  383. readNum= int(p0.decode('utf-8').replace('\n', ''));# get bam total read number
  384. split_num= int(readNum/thread + 50);# set a split thread to split big bam to samll ones
  385. print(time.strftime("%Y-%m-%d %H:%M:%S") + ": There are " + str(readNum) + " reads in this BAM file!" )
  386. p1=subprocess.Popen("samtools view -H " + bamfile +" > " + tmp_prefix + "header; samtools view -@ " + str(thread) +" " + bamfile + " | split - "+ tmp_prefix + " --numeric-suffixes -l " + str(split_num) + " --filter='cat " + tmp_prefix + "header - | samtools view -@ " + str(thread) + " -b - > $FILE.bam'", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate();
  387. # build index for temp bam files
  388. tmpBAM_list= os.listdir(dir + '/tmp_' + sample);
  389. tmpBAM_list= [dir + '/tmp_' + sample + '/' + x for x in tmpBAM_list if not 'header' in x]
  390. for tmpBAM in tmpBAM_list:
  391. p1=subprocess.Popen("samtools index -@ " + str(thread) + " " + tmpBAM, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate();
  392. print(time.strftime("%Y-%m-%d %H:%M:%S") + ": Split BAM file into " + str(thread) + " small BAM files!")
  393. pool=Pool(processes=thread);
  394. process = pool.map(do_parallel_run, range(thread)); #multiple process
  395. result_list = [result for result in process];
  396. results=collections.Counter();
  397. for result in result_list:
  398. results += result;
  399. print(time.strftime("%Y-%m-%d %H:%M:%S") + ": It may take 2~10 minutes to get the final results")
  400. with open(output + sample + '_rawCount.txt', 'w') as f:
  401. for tag, count in results.items():
  402. f.write('{}\t{}\n'.format(tag, count))
  403. shutil.rmtree(dir + '/tmp_' + sample) # remnove the temp folder
  404. global geneSum, countSets;
  405. geneSum = collections.Counter()
  406. countSets = collections.Counter()
  407. for k, v in results.items():
  408. countSets[k] +=v;
  409. geneSum[k[:15]] +=v;
  410. del countSets["uniq_mapped_read"];
  411. keys= [key for key, value in countSets.items()]
  412. pool=Pool(processes=thread);
  413. rpkm_process = pool.map(do_RPKM_run, keys); #multiple process
  414. rpkm_list = [list for list in rpkm_process];
  415. print(time.strftime("%Y-%m-%d %H:%M:%S") + ": RPKM expression calculated!")
  416. # calculate tpm sum and psi value from flaking exons everate tpm
  417. listNum = len(rpkm_list);
  418. tpmList = [x[9] for x in rpkm_list];
  419. global rpkmList, tpmSum;
  420. tpmSum = sum([x for x in tpmList if x != None]);
  421. rpkmList = rpkm_list;
  422. pool=Pool(processes=thread);
  423. tpm_process = pool.map(do_TPM_run, range(listNum)); #multiple process
  424. tpm_list = [list_tpm for list_tpm in tpm_process];
  425. pool.close()
  426. pool.join()
  427. print(time.strftime("%Y-%m-%d %H:%M:%S") + ": TPM and PSI calculated!")
  428. tpm_list = [x[:9] for x in tpm_list if x[2] !='exon']
  429. colname = [['id','count','feature','fullGeneCount','rpkm','tpm','uppExonCount','downExonCount','psi']];
  430. data= colname + tpm_list;
  431. data = pd.DataFrame(data[1:],columns=data[0]);
  432. data.to_csv(output + sample + '_intron_calling_Rawresult.txt', index=False, sep='\t');
  433. intron_list = [x for x in tpm_list if x[2] =='intron' and x[8]!=None and float(x[1]) >= intron_read_filter and float(x[8]) >= intron_psi_filter and float(x[8]) <0.5 and x[6]!=None and x[7]!=None and x[6] >=10 and x[7] >=10 and float(x[4]) >= 1 and float(x[4]) < 100];
  434. # remove common retained intron list from normal samples
  435. intron_list = [x for x in intron_list if x[0] not in normList]
  436. print(time.strftime("%Y-%m-%d %H:%M:%S") + ": Filter " + str(len(normList)) + " commonly retained introns in normal tissue!")
  437. intron_list = colname + intron_list;
  438. intron_data = pd.DataFrame(intron_list[1:], columns=intron_list[0]);
  439. intron_data.to_csv(output + sample + '_intron_candidates.txt', index=False, sep='\t');
  440. novel_list = [x for x in tpm_list if x[2] =='novel-intron' and x[1] >= novel_read_filter]
  441. novel_list = colname + novel_list;
  442. novel_data = pd.DataFrame(novel_list[1:], columns=novel_list[0]);
  443. novel_data.to_csv(output + sample + '_novel-intron_candidates.txt', index=False, sep='\t');
  444. print(time.strftime("%Y-%m-%d %H:%M:%S") + ": All intron-calling job done!")
  445. #
  446. #

intron_calling.py at commit faaa43e, no license · at the source

Overview

Authors: Rudong Li1,2, Jill L Reiter1,2, Season K Wyatt-Johnson3,4, Chuanpeng Dong1,2, Caine S Smith5,6, Nick Green1,2, Hongyu Gao1,2, Sheketha R Hauser4,7, Manav Kapoor8,9, Julia Stevens5,6, R Dayne Mayfield10,11, Alison Goate8,9, Yue Wang2, Howard J Edenberg2,12, Richard L Bell7, Greg Trevor Sutherland5,6, Randy Brutkiewicz3,4, Yunlong Liu1,2
  1. Center for Computational Biology and Bioinformatics (CCBB), Indiana University (IU) School of Medicine, Indianapolis, IN 46202, USA
  2. Department of Medical and Molecular Genetics (MMGE), IU School of Medicine, Indianapolis, IN 46202, USA
  3. Department of Microbiology and Immunology, IU School of Medicine, Indianapolis, IN 46202, USA
  4. Stark Neurosciences Research Institute, IU School of Medicine, Indianapolis, IN 46202, USA
  5. New South Wales (NSW) Brain Tissue Research Centre, University of Sydney, Sydney, NSW 2006, Australia
  6. Charles Perkins Centre and School of Medical Sciences, University of Sydney, Sydney, NSW 2006, Australia
  7. Department of Psychiatry, IU School of Medicine, Indianapolis, IN 46202, USA
  8. Ronald M. Loeb Center for Alzheimer’s Disease, Department of Neuroscience, Icahn School of Medicine at Mount Sinai, New York, NY 10029, USA
  9. Department of Genetics and Genomic Sciences, Icahn School of Medicine at Mount Sinai, New York, NY 10029, USA
  10. Waggoner Center for Alcohol and Addiction Research (WCAAR), University of Texas at Austin, Austin, TX 78712, USA
  11. Department of Neuroscience, University of Texas at Austin, Austin, TX 78712, USA
  12. Department of Biochemistry, Molecular Biology, and Pharmacology, IU School of Medicine, Indianapolis, IN 4620, USA
Journal: Brain communications, volume 8, issue 5, article fcag264
Dates: received 5 November 2025; accepted 4 June 2026; published online 29 July 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1093/braincomms/fcag264 · PMID 42683190 · PMCID PMC13532580 · OpenAlex W7171617883
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: genetics / omics (modality), histology / microscopy (modality), human (organism), rat (organism), other condition (population), cellular / molecular (subfield)
Methods: Statistics, Connectivity, fMRI & imaging
Keywords: alcohol use disorder, double-stranded RNA, intron retention, neuroinflammation, alcohol-preferring P rats
Topic: RNA Research and Splicing (Molecular Biology, Biochemistry, Genetics and Molecular Biology), according to OpenAlex
Funding: NIAAA NIH HHS (R28 AA012725)
Citations: not cited yet (Europe PMC); 76 references in the paper

Abstract

Intron retention, a form of alternative RNA splicing, can occur as part of normal gene regulation or result from disruption of the splicing machinery. Retained introns can potentially form double-stranded RNA, activating innate immune sensors and inflammation. This mechanism has been implicated in cancer but has not been studied in neuropsychiatric diseases like alcohol use disorder. We systematically analysed transcriptome-wide intron retention events in post-mortem brain tissue from 142 individuals (66 with alcohol use disorder and 76 controls), encompassing 320 region-specific samples from the superior frontal cortex, nucleus accumbens, central nucleus and basolateral amygdala. Analyses were adjusted for demographic, technical and biological covariates. Validation was performed in alcohol-preferring (P) rats using long-read sequencing. In complementary experiments, immunofluorescent staining was used to detect double-stranded RNA in rat brain tissue, while single-cell RNA-sequencing was performed to test activation of double-stranded RNA-sensing pathways in human brains. Brains from individuals with alcohol use disorder showed significantly higher total intron retention compared with controls, independent of age, with females showing greater increases than males. A total of 368 introns were positively associated with alcohol use disorder, and these introns were significantly longer and had weaker splice acceptor sites compared with non-associated introns. Genes harbouring these intron retention events were enriched in Purkinje neurons, visual cortex neurons and oligodendrocytes. Computational predictions indicated these long introns could form duplex RNA structures. Increased double-stranded RNA was confirmed experimentally in multiple brain regions of alcohol-consuming rats, where it co-localized primarily with neuronal nuclei and dendrites. In individuals with alcohol use disorder, we found that multiple pathways including double-stranded RNA responses, neuroinflammation, interferon and NF-κB signalling, adaptive immunity and apoptosis were activated. In addition, NeuN-positive neuronal counts significantly decreased in both the prefrontal and visual cortices. Furthermore, single-cell analysis demonstrated upregulation of TICAM1, the target of double-stranded RNA sensor TLR3, in oligodendrocytes, as well as widespread activation of downstream inflammatory pathways across glial and neuronal cell types. These findings provide the first evidence that chronic alcohol consumption promotes an overall increase of intron retention in the brain and is associated with the presence of double-stranded RNA. Furthermore, the double-stranded RNA may contribute to neuronal loss and brain pathology by activating a neuroinflammatory response.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.

cpdong/IntronNeoantigen

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: faaa43e2549522e0f225d2429885fc400e0e20d8, 2 August 2020
Languages: Python (4)
Size: 11 files, 4 scripts
Software Heritage: not archived
Found in: “Data availability”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: pandas (4 files), NumPy (3 files), Biopython (2 files), BEDTools (1 file), SAMtools (1 file), scikit-learn (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
5 files

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 4 scripts, each with its path and the digest of its content;
  • 1 match between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

Datasets cited

Data availability

Human brain sample data are available via the NCBI BioProject database: BLA (PRJNA551909): https://www.ncbi.nlm.nih.gov/bioproject/?term=PRJNA551909, CE (PRJNA551908): https://www.ncbi.nlm.nih.gov/bioproject/?term=PRJNA551908, NAC (PRJNA551775): https://www.ncbi.nlm.nih.gov/bioproject/?term=PRJNA551775, SFC (PRJNA530758): https://www.ncbi.nlm.nih.gov/bioproject/?term=PRJNA530758 and PFC (PRJNA781630): https://www.ncbi.nlm.nih.gov/bioproject/?term=PRJNA781630. The Python tool IR-NeoAg is available via GitHub, https://github.com/cpdong/IntronNeoantigen. WebCSEA is available at https://bioinfo.uth.edu/webcsea/. The R package clusterProfiler is available via Bioconductor, https://bioconductor.org/packages/release/bioc/html/clusterProfiler.html. SPOT-RNA is available via GitHub, https://github.com/jaswindersingh2/SPOT-RNA. The RNA secondary structure tool bpRNA is available via GitHub, https://github.com/hendrixlab/bpRNA. This study did not generate any new code.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 18 authors, 5 keywords, 1 funder, 70 references.

Cite

This paper

Li, R., Reiter, J. L., Wyatt-Johnson, S. K., Dong, C., Smith, C. S., Green, N., Gao, H., Hauser, S. R., Kapoor, M., Stevens, J., Mayfield, R. D., Goate, A., Wang, Y., Edenberg, H. J., Bell, R. L., Sutherland, G. T., Brutkiewicz, R., & Liu, Y. (2026). Elevated intron retention implicates neuroinflammation in brains of individuals with alcohol use disorder. Brain communications, 8(5), fcag264. https://doi.org/10.1093/braincomms/fcag264

BibTeX

@article{li2026elevated,
author = {Li, Rudong and Reiter, Jill L and Wyatt-Johnson, Season K and Dong, Chuanpeng and Smith, Caine S and Green, Nick and Gao, Hongyu and Hauser, Sheketha R and Kapoor, Manav and Stevens, Julia and Mayfield, R Dayne and Goate, Alison and Wang, Yue and Edenberg, Howard J and Bell, Richard L and Sutherland, Greg Trevor and Brutkiewicz, Randy and Liu, Yunlong},
title = {{Elevated intron retention implicates neuroinflammation in brains of individuals with alcohol use disorder}},
journal = {Brain communications},
year = {2026},
month = jul,
volume = {8},
number = {5},
pages = {fcag264},
publisher = {Oxford University Press},
issn = {2632-1297},
doi = {10.1093/braincomms/fcag264},
url = {https://doi.org/10.1093/braincomms/fcag264},
pmid = {42683190},
pmcid = {PMC13532580}
}

RIS

TY - JOUR
AU - Li, Rudong
AU - Reiter, Jill L
AU - Wyatt-Johnson, Season K
AU - Dong, Chuanpeng
AU - Smith, Caine S
AU - Green, Nick
AU - Gao, Hongyu
AU - Hauser, Sheketha R
AU - Kapoor, Manav
AU - Stevens, Julia
AU - Mayfield, R Dayne
AU - Goate, Alison
AU - Wang, Yue
AU - Edenberg, Howard J
AU - Bell, Richard L
AU - Sutherland, Greg Trevor
AU - Brutkiewicz, Randy
AU - Liu, Yunlong
TI - Elevated intron retention implicates neuroinflammation in brains of individuals with alcohol use disorder
T2 - Brain communications
J2 - Brain Commun
PY - 2026
DA - 2026/07/29
VL - 8
IS - 5
SP - fcag264
SN - 2632-1297
PB - Oxford University Press
DO - 10.1093/braincomms/fcag264
UR - https://doi.org/10.1093/braincomms/fcag264
LA - en
ER -

CSL-JSON

{
"id": "10.1093/braincomms/fcag264",
"type": "article-journal",
"title": "Elevated intron retention implicates neuroinflammation in brains of individuals with alcohol use disorder",
"container-title": "Brain communications",
"author": [
{
"family": "Li",
"given": "Rudong"
},
{
"family": "Reiter",
"given": "Jill L"
},
{
"family": "Wyatt-Johnson",
"given": "Season K"
},
{
"family": "Dong",
"given": "Chuanpeng"
},
{
"family": "Smith",
"given": "Caine S"
},
{
"family": "Green",
"given": "Nick"
},
{
"family": "Gao",
"given": "Hongyu"
},
{
"family": "Hauser",
"given": "Sheketha R"
},
{
"family": "Kapoor",
"given": "Manav"
},
{
"family": "Stevens",
"given": "Julia"
},
{
"family": "Mayfield",
"given": "R Dayne"
},
{
"family": "Goate",
"given": "Alison"
},
{
"family": "Wang",
"given": "Yue"
},
{
"family": "Edenberg",
"given": "Howard J"
},
{
"family": "Bell",
"given": "Richard L"
},
{
"family": "Sutherland",
"given": "Greg Trevor"
},
{
"family": "Brutkiewicz",
"given": "Randy"
},
{
"family": "Liu",
"given": "Yunlong"
}
],
"container-title-short": "Brain Commun",
"volume": "8",
"issue": "5",
"page": "fcag264",
"DOI": "10.1093/braincomms/fcag264",
"PMID": "42683190",
"PMCID": "PMC13532580",
"ISSN": "2632-1297",
"publisher": "Oxford University Press",
"URL": "https://doi.org/10.1093/braincomms/fcag264",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
29
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1038/s41586-026-10512-9 [code]
Astrocyte glucocorticoid receptor signalling restricts neuronal plasticity.
Journal: Nature
In common: Biopython, BEDTools, SAMtools, 2 other tools, cellular / molecular, 2 references
[2] doi:10.1038/s41467-026-76675-1 [code]
Long-read proteogenomic atlas of human neuronal differentiation reveals isoform diversity informing neurodevelopmental risk mechanisms.
Journal: Nature communications
In common: Biopython, BEDTools, SAMtools, 3 other tools, genetics / omics, 1 reference
[3] doi:10.1126/sciadv.aed2952 [code]
Activation of transposable elements is linked to a region- and cell type-specific interferon response in Parkinson's disease.
Journal: Science advances
In common: Biopython, BEDTools, SAMtools, 2 other tools, cellular / molecular, 2 references
[4] doi:10.1523/eneuro.0484-25.2026
Epigenetic and Transcriptomic Impacts of Ethanol Vary by Brain Region and Extent of Exposure.
Journal: eNeuro
In common: genetics / omics, 6 references
[5] doi:10.1038/s41592-026-03211-w [code]
Spatial isoform sequencing at single-cell resolution reveals cell-type-specific spatial isoform variability in multiple brain cell types.
Journal: Nature methods
In common: Biopython, BEDTools, SAMtools, 3 other tools, genetics / omics
[6] doi:10.1002/alz.71271 [code]
Intracellular protein GBF1 displays significant associations with amyloid pathology in Alzheimer's disease.
Journal: Alzheimer's & dementia : the journal of the Alzheimer's Association
In common: Biopython, BEDTools, SAMtools, 2 other tools, histology / microscopy, cellular / molecular
[7] doi:10.1101/gr.280394.124 [code]
De novo structural variants in autism spectrum disorder disrupt distal regulatory interactions of neuronal genes.
Journal: Genome research
In common: Biopython, BEDTools, scikit-learn, 2 other tools, cellular / molecular, 2 references
[8] doi:10.1007/s00262-026-04390-3 [code]
Identification and prioritisation of tumour antigen candidates from 79 glioblastoma transcriptomes.
Journal: Cancer immunology, immunotherapy : CII
In common: BEDTools, SAMtools, scikit-learn, 2 other tools, genetics / omics, other condition, cellular / molecular, 1 reference
[9] doi:10.1186/s13059-026-04177-w [code]
Genomic sequence evolution underlying human neocortical interareal diversification.
Journal: Genome biology
In common: BEDTools, SAMtools, scikit-learn, 2 other tools, genetics / omics, cellular / molecular, 1 reference
[10] doi:10.1038/s41467-026-71803-3 [code]
Charting the transition from in vitro gliogenesis to the in vivo maturation of human glial progenitor cells transplanted into the hypomyelinated mouse brain.
Journal: Nature communications
In common: BEDTools, SAMtools, scikit-learn, 2 other tools, genetics / omics, cellular / molecular, 1 reference

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.