Elevated intron retention implicates neuroinflammation in brains of individuals with alcohol use disorder.
One block of code here has a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 1 match
- [1] § Materials and methods › Identification of IR events, quantification of intron content, and statistical analysis ↔ scripts/intron_calling.py, lines 62 to 142 · score 0.60 · HTSeq, uniquely mapped, interval, filtered, exons, events · block
oscr:b:HEG7VAVAQ6BHG-P· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: 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
- import argparse;
- import os,shutil;
- import subprocess;
- import HTSeq,re,time;
- import collections;
- import pandas as pd;
- from multiprocessing import Pool;
- #
- parser = argparse.ArgumentParser()
- parser.add_argument('-b', metavar = 'input', dest='bamFile', help='Give input file fullname');
- parser.add_argument('-g', metavar = 'gtffile', dest='gtfFile', help='Give parsed gtf file fullname');
- parser.add_argument('-t', dest='thread', type=int, help='number of multiple thread number,>0');
- parser.add_argument('-o', metavar = 'output', dest='outputFile',help='Give output file fullname');
- parser.add_argument('-normal', metavar = 'common retain intron list', dest='norm_list',help='provide intron to be removed');
- parser.add_argument('-j', metavar = 'anchor length', type=int, dest='junction',help='Give a specific anchor length');
- parser.add_argument('-c', metavar = 'intronRead filter', dest='intron_read', type=int,help='Set a intron read filter');
- parser.add_argument('-p', metavar = 'intronPSI filter', dest='intron_psi', type=float,help='threshhold of psi value filter');
- parser.add_argument('-n', metavar = 'novel intron read read filter', dest='novel_read', type=int,help='Set a novel intron read filter threshhold');
- args = parser.parse_args();
- bamFile = args.bamFile;
- gtf = args.gtfFile;
- thread = args.thread;
- output = args.outputFile;
- norm_list = args.norm_list;
- junction = args.junction;
- intron_read_filter = args.intron_read;
- intron_psi_filter = args.intron_psi;
- novel_read_filter = args.novel_read;
- cpus= os.cpu_count();# get all available cpu counts
- if thread:
- thread=thread;
- thread= min(thread, cpus); # make sure the maximum thread not over available cpus!
- else:
- thread=1;
- if norm_list:
- normList=[line.strip() for line in open(norm_list, 'r')]; # read from provided remove list
- else:
- normList=[];
- if junction: # the anchor length setting
- junction= junction;
- else:
- junction= 10;
- if intron_read_filter: # the reads fall in intron region filter
- intron_read_filter = intron_read_filter;
- else:
- intron_read_filter = 10;
- if intron_psi_filter: # percentage of intron retained rate!
- intron_psi_filter = intron_psi_filter;
- else:
- intron_psi_filter = 0.05;
- if novel_read_filter: # the anchor length setting
- novel_read_filter = novel_read_filter;
- else:
- novel_read_filter= 15;
- #
- #
- def no_parallel_run():
- global features;
- global bamfile;
- counts = collections.Counter()
- bam = HTSeq.BAM_Reader(bamfile)
- for read in bam:
- #filter1, uniq mapp filter:the option as NM/NH/CC/CP/HI
- NH_list= [x for x in read.optional_fields if x[0]=='NH'];
- if len(NH_list)==0:
- NH_value= 10; # if not NH tag find assign as 10;
- elif len(NH_list)==1:
- NH_value = NH_list[0][1];
- if NH_value == 1 or read.aQual>=30: #filter1, uniq mapp filter
- cigar_list= [cstring.type for cstring in read.cigar]
- cigar_check= [e for e in cigar_list if e in ['D','I','S','H','P','X','=' ]];
- if len(cigar_check)==0:
- counts['uniq_mapped_read'] += 1;#count every unique mapped read for calculate rpkm value
- if cigar_list.count('N') ==0:# call directly
- gene_ids = []; iv_lens=[]
- for iv, val in features[ read.iv ].steps():
- if len(val) ==1:
- gene_ids.append(list(val)[0]);
- ivList= re.split('[:[,)/]',str(iv));
- iv_lens.append(str(int(ivList[3]) - int(ivList[2])))
- 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
- if len(gene_ids)==1:
- gene_id = gene_ids[0];
- counts[gene_id] += 1;
- elif len(gene_ids)>1: #strict the intron at least have length large than anchor
- for g in range(len(gene_ids)):
- gene_id = gene_ids[g];
- iv_len = int(iv_lens[g]);
- geneInfo = re.split('-|@', gene_id)[1]
- if(int(geneInfo)%2==1):
- counts[gene_id] += 1;
- elif (int(geneInfo)%2==0) and (iv_len > junction):
- counts[gene_id] += 1;
- elif cigar_list.count('N') ==1:
- gene_ids = []; iv_lens=[]
- for cigop in read.cigar:
- if cigop.type == "M":
- for iv, val in features[cigop.ref_iv].steps():
- if len(val) ==1:
- gene_ids.append(list(val)[0]);
- ivList= re.split('[:[,)/]',str(iv));
- iv_lens.append(str(int(ivList[3]) - int(ivList[2])))
- if len(set([x[:15] for x in gene_ids]))==1: # remove ambigous mapped read-map to two diff genes
- # get two terminal end of skip region
- if len(gene_ids)>1:
- skip_iv= re.split('[:[,)/]',str(read.cigar[1].ref_iv));
- 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!
- query_ids=set()
- for iv, val in features[new_query].steps():
- query_ids |= val;
- if len(query_ids)>0:
- query_list= [int(re.split('-|@', x)[1]) for x in list(query_ids)];
- query_list.sort();# the mapped region list check
- if query_list[0]%2!=0 and query_list[-1]%2!=0:# if both end at exons
- for g in range(len(gene_ids)):
- gene_id = gene_ids[g];
- iv_len = int(iv_lens[g]);
- geneInfo = re.split('-|@', gene_id)[1]
- if(int(geneInfo)%2==1):
- counts[gene_id] += 1;
- elif (int(geneInfo)%2==0) and (iv_len > junction):
- counts[gene_id] += 1;
- else: # all should be add as novel intron/partial retained events
- novel_id= (list(query_ids)[0])[0:15] + '@' + skip_iv[0] + ':u' + skip_iv[2] + '-d' + skip_iv[3];
- counts[novel_id] += 1;
- elif len(gene_ids)==1: # if disruption occurs inner one feature
- skip_iv= re.split('[:[,)/]',str(read.cigar[1].ref_iv));
- gene_id = list(gene_ids)[0];
- geneInfo = re.split('-|@', gene_id)[1]
- if int(geneInfo)%2==0: # if read mapped within a intron, count it as novel events
- novel_id= gene_id[0:15] + '@' + skip_iv[0] + ':u' + skip_iv[2] + '-d' + skip_iv[3];
- counts[novel_id] += 1;
- print(time.strftime("%Y-%m-%d %H:%M:%S") + ": HTSeq count finished!")
- return counts
- def do_parallel_run(part_N):
- global thread;
- global features;
- global tmp_prefix;
- bamfile_temp= tmp_prefix + "{0:0=2d}".format(part_N) + '.bam'
- counts = collections.Counter()
- bam = HTSeq.BAM_Reader(bamfile_temp)
- for read in bam:
- #filter1, uniq mapp filter:the option as NM/NH/CC/CP/HI
- NH_list= [x for x in read.optional_fields if x[0]=='NH'];
- if len(NH_list)==0:
- NH_value= 10; # if not NH tag find assign as 10;
- elif len(NH_list)==1:
- NH_value = NH_list[0][1];
- if NH_value == 1 or read.aQual>=30: #filter1, uniq mapp filter
- cigar_list= [cstring.type for cstring in read.cigar]
- cigar_check= [e for e in cigar_list if e in ['D','I','S','H','P','X','=' ]];
- if len(cigar_check)==0:
- counts['uniq_mapped_read'] += 1;#count every unique mapped read for calculate rpkm value
- if cigar_list.count('N') ==0:# call directly
- gene_ids = []; iv_lens=[]
- for iv, val in features[ read.iv ].steps():
- if len(val) ==1:
- gene_ids.append(list(val)[0]);
- ivList= re.split('[:[,)/]',str(iv));
- iv_lens.append(str(int(ivList[3]) - int(ivList[2])))
- 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
- if len(gene_ids)==1:
- gene_id = gene_ids[0];
- counts[gene_id] += 1;
- elif len(gene_ids)>1: #strict the intron at least have length large than anchor
- for g in range(len(gene_ids)):
- gene_id = gene_ids[g];
- iv_len = int(iv_lens[g]);
- geneInfo = re.split('-|@', gene_id)[1]
- if(int(geneInfo)%2==1):
- counts[gene_id] += 1;
- elif (int(geneInfo)%2==0) and (iv_len > junction):
- counts[gene_id] += 1;
- elif cigar_list.count('N') ==1:
- gene_ids = []; iv_lens=[]
- for cigop in read.cigar:
- if cigop.type == "M":
- for iv, val in features[cigop.ref_iv].steps():
- if len(val) ==1:
- gene_ids.append(list(val)[0]);
- ivList= re.split('[:[,)/]',str(iv));
- iv_lens.append(str(int(ivList[3]) - int(ivList[2])))
- if len(set([x[:15] for x in gene_ids]))==1: # remove ambigous mapped read-map to two diff genes
- # get two terminal end of skip region
- if len(gene_ids)>1:
- skip_iv= re.split('[:[,)/]',str(read.cigar[1].ref_iv));
- 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!
- query_ids=set()
- for iv, val in features[new_query].steps():
- query_ids |= val;
- if len(query_ids)>0:
- query_list= [int(re.split('-|@', x)[1]) for x in list(query_ids)];
- query_list.sort();# the mapped region list check
- if query_list[0]%2!=0 and query_list[-1]%2!=0:# if both end at exons
- for g in range(len(gene_ids)):
- gene_id = gene_ids[g];
- iv_len = int(iv_lens[g]);
- geneInfo = re.split('-|@', gene_id)[1]
- if(int(geneInfo)%2==1):
- counts[gene_id] += 1;
- elif (int(geneInfo)%2==0) and (iv_len > junction):
- counts[gene_id] += 1;
- else: # all should be add as novel intron/partial retained events
- novel_id= (list(query_ids)[0])[0:15] + '@' + skip_iv[0] + ':u' + skip_iv[2] + '-d' + skip_iv[3];
- counts[novel_id] += 1;
- elif len(gene_ids)==1: # if disruption occurs inner one feature
- skip_iv= re.split('[:[,)/]',str(read.cigar[1].ref_iv));
- gene_id = list(gene_ids)[0];
- geneInfo = re.split('-|@', gene_id)[1]
- if int(geneInfo)%2==0: # if read mapped within a intron, count it as novel events
- novel_id= gene_id[0:15] + '@' + skip_iv[0] + ':u' + skip_iv[2] + '-d' + skip_iv[3];
- counts[novel_id] += 1;
- print(time.strftime("%Y-%m-%d %H:%M:%S") + ": Process " + str(part_N) + " finished!")
- return counts
- def single_thread_RPKM(counter):
- geneSum = collections.Counter()
- countSets = collections.Counter()
- for k, v in counter.items():
- countSets[k] +=v;
- geneSum[k[:15]] +=v;
- del countSets["uniq_mapped_read"];
- keys= [key for key, value in countSets.items()];
- rpkm_list = [];
- for key in keys:
- value = countSets[key];
- list=[key, value] + [None]*10;
- extron_list= re.split('-|@|:|-', key);
- list[3] = geneSum[extron_list[0]];
- if len(extron_list)==5:
- extron_len = int(extron_list[4]) - int(extron_list[3]) + 1;
- list[9] = value*1000/extron_len;
- list[4] = round(value*(10**9)/(geneSum['uniq_mapped_rea'] * extron_len), 4);
- if (int(extron_list[1])%2==0):
- list[2] = 'intron';
- uExon = extron_list[0] + '-' + str(int(extron_list[1]) -1);
- dExon = extron_list[0] + '-' + str(int(extron_list[1]) + 1);
- upperExon = [[key, value] for key, value in countSets.items() if uExon in key];
- downExon = [[key, value] for key, value in countSets.items() if dExon in key]
- if len(upperExon) ==1:
- upperList = re.split('-|@|:|-', upperExon[0][0]);
- list[6] = upperExon[0][1]; list[10] = int(upperList[4])-int(upperList[3])+1;
- if len( downExon) == 1:
- downList = re.split('-|@|:|-', downExon[0][0]);
- list[7] = downExon[0][1]; list[11] = int(downList[4])-int(downList[3])+1;
- elif (int(extron_list[1])%2==1):
- list[2] = 'exon';
- elif len(extron_list)==4:
- list[2] = 'novel-intron';
- rpkm_list.append(list)
- return rpkm_list
- def do_RPKM_run(key):
- global geneSum;
- global countSets;
- value = countSets[key];
- list=[key, value] + [None]*10;
- extron_list= re.split('-|@|:|-', key);
- list[3] = geneSum[extron_list[0]];
- if len(extron_list)==5:
- extron_len = int(extron_list[4]) - int(extron_list[3]) + 1;
- list[9] = value*1000/extron_len;
- list[4] = round(value*(10**9)/(geneSum['uniq_mapped_rea'] * extron_len), 4);
- if (int(extron_list[1])%2==0):
- list[2] = 'intron';
- uExon = extron_list[0] + '-' + str(int(extron_list[1]) -1);
- dExon = extron_list[0] + '-' + str(int(extron_list[1]) + 1);
- upperExon = [[key, value] for key, value in countSets.items() if uExon in key];
- downExon = [[key, value] for key, value in countSets.items() if dExon in key]
- if len(upperExon) ==1:
- upperList = re.split('-|@|:|-', upperExon[0][0]);
- list[6] = upperExon[0][1]; list[10] = int(upperList[4])-int(upperList[3])+1;
- if len( downExon) == 1:
- downList = re.split('-|@|:|-', downExon[0][0]);
- list[7] = downExon[0][1]; list[11] = int(downList[4])-int(downList[3])+1;
- elif (int(extron_list[1])%2==1):
- list[2] = 'exon';
- elif len(extron_list)==4:
- list[2] = 'novel-intron';
- return list
- def single_thread_TPM(rpkm_list):
- listNum = len(rpkm_list);
- tpmList = [x[9] for x in rpkm_list];
- tpmSum = sum([x for x in tpmList if x != None]);
- tpm_list = [];
- for i in range(listNum):
- list_tpm = rpkm_list[i];
- if list_tpm[2] == 'intron':
- extron_list= re.split('-|@|:|-', list_tpm[0]);
- extron_len = int(extron_list[4]) - int(extron_list[3]) + 1;
- tpm_val = list_tpm[1]*(10**9)/(extron_len * tpmSum);
- list_tpm[5]= round(tpm_val, 4);
- if list_tpm[6] !=None:
- tpm_upper = list_tpm[6]*(10**9)/(list_tpm[10]* tpmSum);
- else:
- tpm_upper = 0;
- if list_tpm[7] !=None:
- tpm_down = list_tpm[7]*(10**9)/(list_tpm[11]* tpmSum);
- else:
- tpm_down = 0;
- tpm_flake=[tpm_upper, tpm_down]
- if sum(tpm_flake)!=0:
- list_tpm[8] = round(tpm_val*2/sum(tpm_flake), 3);
- else:
- list_tpm = list_tpm;
- tpm_list.append(list_tpm);
- return tpm_list
- def do_TPM_run(index):
- list_tpm = rpkm_list[index];
- if list_tpm[2] == 'intron':
- extron_list= re.split('-|@|:|-', list_tpm[0]);
- extron_len = int(extron_list[4]) - int(extron_list[3]) + 1;
- tpm_val = list_tpm[1]*(10**9)/(extron_len * tpmSum);
- list_tpm[5]= round(tpm_val, 4);
- if list_tpm[6] !=None:
- tpm_upper = list_tpm[6]*(10**9)/(list_tpm[10]* tpmSum);
- else:
- tpm_upper = 0;
- if list_tpm[7] !=None:
- tpm_down = list_tpm[7]*(10**9)/(list_tpm[11]* tpmSum);
- else:
- tpm_down = 0;
- tpm_flake=[tpm_upper, tpm_down]
- if sum(tpm_flake)!=0:
- list_tpm[8] = round(tpm_val*2/sum(tpm_flake), 3);
- else:
- list_tpm = list_tpm
- return list_tpm
- if __name__ == '__main__':
- global features;
- features = HTSeq.GenomicArrayOfSets( "auto", stranded=True )
- for line in open(gtf):
- fields = line.split( "\t" );
- chrom= fields[0]; start=int(fields[2]); end= int(fields[3])+1; strand=fields[4];
- name= fields[5].split('.')[0] + '-' + str(fields[12]) + '@' + fields[0] + ':' + str(fields[2]) + '-' + str(fields[3]);
- iv = HTSeq.GenomicInterval(chrom, start, end, strand)
- features[ iv ] += name;
- global bamfile;
- bamfile = bamFile;
- dir= '/'.join(bamfile.split('/')[0:-1]);
- s1= bamfile.split('/')[-1];
- sample= s1.replace('.bam', '');
- if output:
- if output[-1] =='/':
- output = output;
- else:
- output = output + '/'
- else:
- output = dir + '/'; # defualt located at your input bam file
- if thread==1:
- print("No parallel mode, thread =",thread)
- results= no_parallel_run();
- with open(output + sample + '_rawCount.txt', 'w') as f:
- for tag, count in results.items():
- f.write('{}\t{}\n'.format(tag, count))
- rpkm_list= single_thread_RPKM(results);
- print(time.strftime("%Y-%m-%d %H:%M:%S") + ": RPKM expression calculated!")
- tpm_list = single_thread_TPM(rpkm_list);
- print(time.strftime("%Y-%m-%d %H:%M:%S") + ": TPM and PSI calculated!")
- tpm_list = [x[:9] for x in tpm_list if x[2] !='exon']
- colname = [['id','count','feature','fullGeneCount','rpkm','tpm','uppExonCount','downExonCount','psi']];
- data= colname + tpm_list;
- data = pd.DataFrame(data[1:],columns=data[0]);
- data.to_csv(output + sample + '_intron_calling_Rawresult.txt', index=False, sep='\t');
- 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]
- # remove common retained intron list from normal samples
- intron_list = [x for x in intron_list if x[0] not in normList]
- print(time.strftime("%Y-%m-%d %H:%M:%S") + ": Filter " + str(len(normList)) + " commonly retained introns in normal tissue!")
- intron_list = colname + intron_list;
- intron_data = pd.DataFrame(intron_list[1:], columns=intron_list[0]);
- intron_data.to_csv(output + sample + '_intron_candidates.txt', index=False, sep='\t');
- 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]
- novel_list = colname + novel_list;
- novel_data = pd.DataFrame(novel_list[1:], columns=novel_list[0]);
- novel_data.to_csv(output + sample + '_novel-intron_candidates.txt', index=False, sep='\t');
- print(time.strftime("%Y-%m-%d %H:%M:%S") + ": All intron-calling job done!")
- #
- else:
- print("thread =",thread)
- if not os.path.exists(dir + '/tmp_' + sample):
- os.makedirs(dir + '/tmp_' + sample)# create a folder for speeding calculation
- global tmp_prefix;
- tmp_prefix = dir + '/tmp_' + sample + '/tmp_'
- p0=subprocess.Popen("samtools view -@ " + str(thread) + " -c " + bamfile, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0];
- readNum= int(p0.decode('utf-8').replace('\n', ''));# get bam total read number
- split_num= int(readNum/thread + 50);# set a split thread to split big bam to samll ones
- print(time.strftime("%Y-%m-%d %H:%M:%S") + ": There are " + str(readNum) + " reads in this BAM file!" )
- 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();
- # build index for temp bam files
- tmpBAM_list= os.listdir(dir + '/tmp_' + sample);
- tmpBAM_list= [dir + '/tmp_' + sample + '/' + x for x in tmpBAM_list if not 'header' in x]
- for tmpBAM in tmpBAM_list:
- p1=subprocess.Popen("samtools index -@ " + str(thread) + " " + tmpBAM, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate();
- print(time.strftime("%Y-%m-%d %H:%M:%S") + ": Split BAM file into " + str(thread) + " small BAM files!")
- pool=Pool(processes=thread);
- process = pool.map(do_parallel_run, range(thread)); #multiple process
- result_list = [result for result in process];
- results=collections.Counter();
- for result in result_list:
- results += result;
- print(time.strftime("%Y-%m-%d %H:%M:%S") + ": It may take 2~10 minutes to get the final results")
- with open(output + sample + '_rawCount.txt', 'w') as f:
- for tag, count in results.items():
- f.write('{}\t{}\n'.format(tag, count))
- shutil.rmtree(dir + '/tmp_' + sample) # remnove the temp folder
- global geneSum, countSets;
- geneSum = collections.Counter()
- countSets = collections.Counter()
- for k, v in results.items():
- countSets[k] +=v;
- geneSum[k[:15]] +=v;
- del countSets["uniq_mapped_read"];
- keys= [key for key, value in countSets.items()]
- pool=Pool(processes=thread);
- rpkm_process = pool.map(do_RPKM_run, keys); #multiple process
- rpkm_list = [list for list in rpkm_process];
- print(time.strftime("%Y-%m-%d %H:%M:%S") + ": RPKM expression calculated!")
- # calculate tpm sum and psi value from flaking exons everate tpm
- listNum = len(rpkm_list);
- tpmList = [x[9] for x in rpkm_list];
- global rpkmList, tpmSum;
- tpmSum = sum([x for x in tpmList if x != None]);
- rpkmList = rpkm_list;
- pool=Pool(processes=thread);
- tpm_process = pool.map(do_TPM_run, range(listNum)); #multiple process
- tpm_list = [list_tpm for list_tpm in tpm_process];
- pool.close()
- pool.join()
- print(time.strftime("%Y-%m-%d %H:%M:%S") + ": TPM and PSI calculated!")
- tpm_list = [x[:9] for x in tpm_list if x[2] !='exon']
- colname = [['id','count','feature','fullGeneCount','rpkm','tpm','uppExonCount','downExonCount','psi']];
- data= colname + tpm_list;
- data = pd.DataFrame(data[1:],columns=data[0]);
- data.to_csv(output + sample + '_intron_calling_Rawresult.txt', index=False, sep='\t');
- 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];
- # remove common retained intron list from normal samples
- intron_list = [x for x in intron_list if x[0] not in normList]
- print(time.strftime("%Y-%m-%d %H:%M:%S") + ": Filter " + str(len(normList)) + " commonly retained introns in normal tissue!")
- intron_list = colname + intron_list;
- intron_data = pd.DataFrame(intron_list[1:], columns=intron_list[0]);
- intron_data.to_csv(output + sample + '_intron_candidates.txt', index=False, sep='\t');
- novel_list = [x for x in tpm_list if x[2] =='novel-intron' and x[1] >= novel_read_filter]
- novel_list = colname + novel_list;
- novel_data = pd.DataFrame(novel_list[1:], columns=novel_list[0]);
- novel_data.to_csv(output + sample + '_novel-intron_candidates.txt', index=False, sep='\t');
- print(time.strftime("%Y-%m-%d %H:%M:%S") + ": All intron-calling job done!")
- #
- #
intron_calling.py at commit faaa43e, no license · at the source
Overview
- Center for Computational Biology and Bioinformatics (CCBB), Indiana University (IU) School of Medicine, Indianapolis, IN 46202, USA
- Department of Medical and Molecular Genetics (MMGE), IU School of Medicine, Indianapolis, IN 46202, USA
- Department of Microbiology and Immunology, IU School of Medicine, Indianapolis, IN 46202, USA
- Stark Neurosciences Research Institute, IU School of Medicine, Indianapolis, IN 46202, USA
- New South Wales (NSW) Brain Tissue Research Centre, University of Sydney, Sydney, NSW 2006, Australia
- Charles Perkins Centre and School of Medical Sciences, University of Sydney, Sydney, NSW 2006, Australia
- Department of Psychiatry, IU School of Medicine, Indianapolis, IN 46202, USA
- Ronald M. Loeb Center for Alzheimer’s Disease, Department of Neuroscience, Icahn School of Medicine at Mount Sinai, New York, NY 10029, USA
- Department of Genetics and Genomic Sciences, Icahn School of Medicine at Mount Sinai, New York, NY 10029, USA
- Waggoner Center for Alcohol and Addiction Research (WCAAR), University of Texas at Austin, Austin, TX 78712, USA
- Department of Neuroscience, University of Texas at Austin, Austin, TX 78712, USA
- Department of Biochemistry, Molecular Biology, and Pharmacology, IU School of Medicine, Indianapolis, IN 4620, USA
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
faaa43e2549522e0f225d2429885fc400e0e20d8, 2 August 2020Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
5 files
- scripts/
gtf_parse.py , Python, 296 lines - scripts/
intron_calling.py , Python, 496 lines, 1 match - scripts/
mhc_present.py , Python, 418 lines - scripts/
predict_immunogenicity.p , Python, 347 linesy - README.md, Text, 74 lines
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
- bioproject:PRJNA551909, at NCBI BioProject; found in “Data availability”
Data availability
Human brain sample data are available via the NCBI BioProject database: BLA (PRJNA551909): https://
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://
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/
url = {https://
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/
VL - 8
IS - 5
SP - fcag264
SN - 2632-1297
PB - Oxford University Press
DO - 10.1093/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1093/
"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":
"volume": "8",
"issue": "5",
"page": "fcag264",
"DOI": "10.1093/
"PMID": "42683190",
"PMCID": "PMC13532580",
"ISSN": "2632-1297",
"publisher": "Oxford University Press",
"URL": "https://
"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.1002/humu.24379 [code]
- Bioinformatics detection of modulators controlling splicing factor-dependent intron retention in the human brain.Journal: Human mutationIn common: BEDTools, genetics / omics, cellular / molecular, 4 references, author Yunlong Liu
- [2] doi:10.1016/j.celrep.2021.110022 [code]
- Full-length transcript sequencing of human and mouse cerebral cortex identifies widespread isoform diversity and alternative splicing.Journal: Cell reportsIn common: Biopython, BEDTools, SAMtools, 3 other tools, genetics / omics, cellular / molecular, 3 references
- [3] doi:10.1038/s41467-026-68351-1 [code]
- Central amygdala single-nucleus atlas reveals chromatin and gene transcription dynamics in human alcohol use disorder.Journal: Nature communicationsIn common: scikit-learn, pandas, NumPy, genetics / omics, other condition, cellular / molecular, 5 references
- [4] doi:10.1126/sciadv.ado5820 [code]
- Polygenic risk for alcohol use disorder affects cellular responses to ethanol exposure in a human microglial cell model.Journal: Science advancesIn common: SAMtools, genetics / omics, other condition, cellular / molecular, 2 references, author Yunlong Liu
- [5] doi:10.1523/eneuro.0484-25.2026
- Epigenetic and Transcriptomic Impacts of Ethanol Vary by Brain Region and Extent of Exposure.Journal: eNeuroIn common: genetics / omics, 6 references
- [6] doi:10.1038/s41467-025-65339-1 [code]
- The implications of alternative splicing regulation for maximum lifespan.Journal: Nature communicationsIn common: BEDTools, SAMtools, scikit-learn, 2 other tools, cellular / molecular, 2 references
- [7] doi:10.1016/j.jbc.2022.102147 [code]
- Astrocyte ethanol exposure reveals persistent and defined calcium response subtypes and associated gene signatures.Journal: The Journal of biological chemistryIn common: Biopython, BEDTools, SAMtools, genetics / omics, cellular / molecular, 2 references
- [8] doi:10.1007/s12031-025-02469-7 [code]
- Utilisation of Machine Learning Approaches Improves RNA-Seq Transcriptome Analyses in Alzheimer's Disease Brain.Journal: Journal of molecular neuroscience : MNIn common: BEDTools, SAMtools, NumPy, genetics / omics, cellular / molecular, 4 references
- [9] doi:10.1186/s13059-025-03724-1 [code]
- Long-read sequencing reveals the RNA isoform repertoire of neuropsychiatric risk genes in human brain.Journal: Genome biologyIn common: BEDTools, SAMtools, pandas, 1 other tool, genetics / omics, cellular / molecular, 2 references
- [10] doi:10.1038/s41467-025-67931-x [code]
- Splice isoform-perturbation coupled to single cell transcriptome profiling reveals functions of microexons in neurogenesis and autism-linked pathways.Journal: Nature communicationsIn common: BEDTools, SAMtools, scikit-learn, 2 other tools, genetics / omics, 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 4 scripts, and 1 match between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:6a7664f6cd683438…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1093/braincomms/fcag264)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1093/braincomms/fcag264.svg
:target: https://openscicode.org/badge/doi/10.1093/braincomms/fcag264
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1093/braincomms/fcag264"><img src="https://openscicode.org/badge/doi/10.1093/braincomms/fcag264.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge 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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
