// _ _ ______ _______ __ _ _ // | \ | | ____|__ __/ _(_) | | // | \| | |__ | | | |_ _ _ __ __| | ___ _ __ // | . ` | __| | | | _| | '_ \ / _` |/ _ \ '__| // | |\ | |____ | | | | | | | | | (_| | __/ | // |_| \_|______| |_| |_| |_|_| |_|\__,_|\___|_| //Egeblad lab's **NETfinder** for batch-processing of LIF files. //Before running, please confirm in which channels are your DAPI, citH3 and MPO //Then, on first use please **confirm by manual inspection** the soundness of the results! macro 'batchNETfinder' { run("Bio-Formats Macro Extensions"); tresh_suggested=5; Dialog.create("NET-finder"); Dialog.addMessage("Welcome to NETfinder!\n ", 15); Dialog.addChoice("Channel for DNA:", newArray("1", "2", "3", "4", "5", "6"), 1); Dialog.addChoice("Channel for citH3:", newArray("1", "2", "3", "4", "5", "6"), 2); Dialog.addChoice("Channel for MPO:", newArray("1", "2", "3", "4", "5", "6"), 3); Dialog.addString("Multiplier for mean citH3 signal:", tresh_suggested); Dialog.show(); ch_dna = parseInt(Dialog.getChoice()); ch_h3 = parseInt(Dialog.getChoice()); ch_mpo = parseInt(Dialog.getChoice()); tresh = parseInt(Dialog.getString()); waitForUser("Attention", "In the next dialog, chose the folder where your LIF files are located."); dir1 = getDirectory("Choose folder with lif files "); list = getFileList(dir1); outpath = dir1+File.separator+"output"; if (File.exists(outpath)==false) { File.makeDirectory(outpath); } setBatchMode(false); globalcounter=0; title1 = "Quantification"; title2 = "["+title1+"]"; tablita=title2; run("New... ", "name="+title2+" type=Table"); print(tablita,"\\Headings:File\tSeries\tCount\tNETs\tRatio"); //Here i is file, j is series, k is ROI for (i=0; i(mean_cith3*tresh) && mean2>min2/3) { setResult("Colocalized", k, 1); coloc = coloc+1; } else { setResult("Colocalized", k, 0); } } ratio=coloc/count; print(tablita,list[i]+"\t"+j+"\t"+count+"\t"+coloc+"\t"+ratio); Plot.create("Plot of Results", "ch1_mean", "ch2_mean"); Plot.add("Circle", Table.getColumn("ch1_mean", "Results"), Table.getColumn("ch2_mean", "Results")); Plot.setStyle(0, "blue,#a0a0ff,1.0,Circle"); Plot.drawLine(mean_cith3*tresh,0,mean_cith3*tresh,300); Plot.drawLine(0,min2/3,300,min2/3); Plot.setLogScaleX(false); Plot.setLogScaleY(false); Plot.setLimits(0,299,0,299); Plot.show; roiManager("Show None"); selectWindow("MAX_orig"); run("Split Channels"); run("Merge Channels...", "c1=C"+ch_h3+"-MAX_orig c4=C"+ch_mpo+"-MAX_orig create"); selectWindow("Composite"); Stack.setDisplayMode("color"); Stack.setChannel(1); run("Red"); resetMinAndMax(); Stack.setChannel(2); run("Cyan"); resetMinAndMax(); Stack.setDisplayMode("composite"); run("Stack to RGB"); selectWindow("Composite (RGB)"); saveAs("Tiff", outpath+File.separator+list[i]+"_"+seriesname+".tif"); selectWindow("Plot of Results"); Plot.makeHighResolution("Plot of Results_HiRes",2.0); selectWindow("Plot of Results_HiRes"); saveAs("Tiff", outpath+File.separator+list[i]+"_"+seriesname+"PLOT.tif"); if (isOpen("ROI Manager")) { selectWindow("ROI Manager"); roiManager("Delete"); } run("Clear Results"); run("Close All"); run("Collect Garbage"); } } selectWindow(title1); saveAs("Text", outpath+File.separator+"Quantification.csv"); showMessage(" -- DONE -- \nI outputted graphs and overlays of citH3 and MPO to\n"+outpath+"\nThere you also have the file Quantification.csv with the results.\nPlease, do a soundness check on the output."); run("Close All"); run("Collect Garbage"); setBatchMode(false); }