Call Mageck in PScript

From Array Suite Wiki

Jump to: navigation, search


An Pscript to Call Mageck and load outputed tables

This script was contributed by Jeff Du for OmicSoft community use. Designed to call Mageck, this can be used to import two expression matrices, to be loaded into a Server project.

It was written to be exposed to GUI, allowing other Array Studio users to load input data to Mageck and get the output tables.

Overall Design

  • Pre-requirments
    • Linux OS with ArrayServer running
    • Mageck has been correctly installed, PATH has been configured
  • Users run Pipeline script to choose input file for Mageck
    • Two parameters:
      • The input file needs to be in a location where ArrayServer can read, so that the command line could be executed
      • Specify an output folder to keep all the output matrices
  • run a OScript section, to load output table to Server project
  • run another OScript section, to load the second output table to server project

Call Mageck and load output matrices.pscript

Label= Call Mageck from PScript
Description=PS to Call Mageck with RefGene, save demo summary file
ExternalScriptMenuText= Mageck Custom Pipeline
ExternalScriptFileFilter=FASTQ files|*.fastq|.gz|*.gz|*.txt
~@ThreadNumberPerJob@=Number of threads to run for each of the steps.
~@ParallelJobNumber@=Number of parallel jobs to run for each of the steps
~@Gzip@=Set to Gzip if input files are gzipped or None
~@OutputFolderName@=Output folder for results and summary files
//Call mageck section
Begin RunEScript /RunonServer=True;
EScriptName Mageck;
Command mkdir "@OutputFolderName@/output0406"; 
Command cd "@OutputFolderName@/output0406";
Command pwd;
Command mageck "test" -k "%FilePath%" -t "," -c "HL60.initial,KBM7.initial"  -n "demo";
Options /ParallelJobNumber=1 /ThreadNumberPerJob=8 /ErrorOnStdErr=False;
Begin SaveProject;
Begin ImportTable /Namespace=Table /RunOnServer=True;
#Project 0406_Mageck_test;
File "@OutputFolderName@/output0406/demo.gene_summary.txt";
Options  /Format=Txt;
Begin SaveProject;
Begin ImportTable /Namespace=Table /RunOnServer=True;
#Project 0406_Mageck_test;
File "@OutputFolderName@/output0406/demo.sgrna_summary.txt";
Options  /Format=Txt;
Begin SaveProject;

Check Mageck installation

Be sure to set /Path/ for Mageck

Call mageck.png

Add call_Mageck_fromAS PScript to ArrayServer

After saving the pscript to a *.pscript file, go to ArrayServer -> Manage -> Script. in the Manage Server Scripts window, cleck Add Script, and load the pscript.

Add pscript.png

Workflow to call Mageck in ArrayStudio

  • Create a server project
  • Go to Scripts -> NGS -> Mageck_test -> MageckCustomPipeline


  • Specify input file and output folder

Specify input output.png

  • Output matrices

Output mageck.png

[back to top]