Skip to content

Commit

Permalink
Merge pull request #22 from NIB-SI/develop
Browse files Browse the repository at this point in the history
fixes before webinar
  • Loading branch information
ablejec authored Nov 13, 2018
2 parents 2b576ab + 851af3a commit 60280c0
Show file tree
Hide file tree
Showing 20 changed files with 225 additions and 272 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ $RECYCLE.BIN/
Network Trash Folder
Temporary Items
.apdisk
Metadata.md
xCheckMetadata.md
Binary file removed INSTRUCTIONS-v-5-0-0.docx
Binary file not shown.
Binary file added INSTRUCTIONS-v-6.pdf
Binary file not shown.
135 changes: 0 additions & 135 deletions INSTRUCTIONS.MD

This file was deleted.

4 changes: 2 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pISA-tree: Standard project directory tree (ISA compliant)
# pISA-tree: Standard project directory tree (ISA-tab compliant)

This set of batch files is used to create standard directory tree for research projects.
Batch files are provided to make standardized nested directories in accordance with the ISA-tab framework (**I**nvestigation/**S**tudy/**A**ssay).
Expand All @@ -7,7 +7,7 @@ Installation:

1. Download (zip file) or clone the repository from [NIB GitHub](https://github.com/NIB-SI/pISA/archive/projects.zip).
2. Extract files into your local pISA projects directory (ignore or delete .git-related files).
3. User instructions are in INSTRUCTIONS.\* files.
3. User instructions are in INSTRUCTIONS\* file.

Additional info:
* files in `doc` folder
Expand Down
1 change: 1 addition & 0 deletions Templates/DRY/R/AssayType.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Creation date %today%
1 change: 1 addition & 0 deletions Templates/DRY/Stat/AssayType.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Creation date %today%
1 change: 1 addition & 0 deletions Templates/WET/DNAse/AssayType.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Creation date %today%
Dnase ID DNase_$
Date DNAse_treatment %today%
Storage_DNAse_treated CU0370
Expand Down
11 changes: 0 additions & 11 deletions Templates/WET/Demo/AssayType.ini

This file was deleted.

2 changes: 1 addition & 1 deletion Templates/WET/RNAisol/AssayType.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Creation date %today%
RNA ID $_RNA
ng/ul Blank
260/280 Blank
Expand All @@ -15,4 +16,3 @@ Operator Katja Stare/Anna Coll/Rebecca Vollmeier/Barbara Dusak/Maru
cDNA ID $_cDNA
DateRT %today%
Notes

7 changes: 0 additions & 7 deletions Templates/WET/RNAisol/AssayType_small.ini

This file was deleted.

1 change: 1 addition & 0 deletions Templates/WET/RT/AssayType.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Creation date %today%
RT ID RT_$
Add column 1 Blank
Add column 2 Blank
Expand Down
76 changes: 51 additions & 25 deletions Templates/makeAssay.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ rem Backup copy if assay folder exists
rem robocopy %1 X-%1 /MIR
rem ------------------------------------------------------
rem
TITLE pISA-tree
setlocal EnableDelayedExpansion
set LF=^

Expand Down Expand Up @@ -118,7 +119,7 @@ if exist %tmpldir%\DRY\%NewType% (
goto Ask4)
rem type ok
md %tmpldir%\%IDClass%\%NewType%
copy NUL %tmpldir%\%IDClass%\%NewType%\AssayType.ini /Y > NUL
echo Creation date %today%> %tmpldir%\%IDClass%\%NewType%\AssayType.ini
echo New %IDClass% Assay Type was created: %NewType%
set "IDType=%NewType%"
)
Expand Down Expand Up @@ -235,11 +236,11 @@ call:getLayer _S_ sname
call:getLayer _A_ aname
rem -------------------------------------- make ASSAY_DESCRIPTION
set descFile=".\_ASSAY_METADATA.TXT"
echo project: %pname%> %descFile%
echo Investigation: %iname%>> %descFile%
echo Assay: %Adir%> %descFile%
echo Study: %sname%>> %descFile%
echo Assay: %Adir%>> %descFile%
echo ### ASSAY>> %descFile%
echo Investigation: %iname%>> %descFile%
echo project: %pname%>> %descFile%
rem echo ### ASSAY>> %descFile%
echo Short Name: %ID%>> %descFile%
echo Assay Class: %IDClass%>> %descFile%
echo Assay Type: %IDType%>> %descFile%
Expand All @@ -248,7 +249,21 @@ rem ECHO ON
rem if exist ../%analytesInput% ( copy ../%analytesInput% ./%analytesInput% )
call:inputMeta "Title" aTitle *
call:inputMeta "Description" aDesc *
rem echo Assay Path: %cd:\=/%>> %descFile%
rem set phenodata file
SETLOCAL ENABLEDELAYEDEXPANSION
SET "pfns="
FOR /f "delims=" %%i IN ('dir %iroot%\phenodata_20*.* /B') DO (
SET pfns=!pfns!%%i/
)
SETLOCAL DISABLEDELAYEDEXPANSION
call:getMenu "Select phenodata file" "%pfns%None" pfn
if "%pfn%" EQU "None" ( echo Phenodata: %pfn%>> %descFile%
) ELSE ( echo Phenodata: %iroot:\=/%/%pfn%>> %descFile%)
rem ---- Type specific fields
set tasdir=%tmpldir%\%IDClass%\%IDType%
set "line1="
set "line2="
if /I "%IDClass%"=="WET" goto wetclass
if /I "%IDClass%"=="DRY" goto dryclass
rem if /I "%IDType%" == "R" goto R
Expand All @@ -265,16 +280,13 @@ rem echo tst %tmpldir%\%IDClass%\%IDType%\AssayType.ini
rem dir %tmpldir%
rem dir ..\%tmpldir%
rem Assay type directory
set tasdir=%tmpldir%\%IDClass%\%IDType%
rem dir %tasdir%
rem dir %tmpldir%
:: echo %cd%
set "analytesInput=Analytes.txt"
call:getSamples %IDName% %iroot%\phenodata.txt %aroot%\%analytesInput%
call:getSamples %IDName% %iroot%\%pfn% %aroot%\%analytesInput%
setlocal disabledelayedexpansion
rem if exist %sroot%\%analytesInput% ( copy %sroot%\%analytesInput% %aroot%\%analytesInput% )
set "line1="
set "line2="
rem dir %tmpldir%\%IDClass%\%IDType%\
if exist %tasdir%\AssayType.ini call:processAnalytes %tasdir%\AssayType.ini

Expand All @@ -292,8 +304,8 @@ REM ---------------------------------------- /dryclass
:Finish
echo Data: >> %descFile%
rem ------------------------------------ include common.ini from project level
copy %descFile%+..\common.ini %descFile% >NUL
echo ASSAY: %ID%>> ..\_STUDY_METADATA.TXT
copy %descFile%+..\common.ini %descFile% \b >NUL
rem echo ASSAY: %ID%>> ..\_STUDY_METADATA.TXT
copy %sroot%\showTree.bat . >NUL
copy %sroot%\showMetadata.bat . >NUL
copy %sroot%\xcheckMetadata.bat . >NUL
Expand All @@ -302,8 +314,12 @@ rem
rem make main readme.md file
rem type README.MD
rem dir .
rem cls
rem type %descFile%
cls
echo ======================================
echo Assay METADATA
echo ======================================
rem call:showDesc %descFile%
type %descFile%
cd ..
rem copy existing files from nonversioned tree (if any)
rem robocopy X-%ID% %ID% /E
Expand Down Expand Up @@ -369,7 +385,7 @@ rem call:getInput "%~1" xMeta "%~3"
rem Type input or get menu?

call:getMenu "%~1" %~3/getMenu xMeta "%~3"
echo %~1: %xMeta% >> %descFile%
echo %~1: %xMeta%>> %descFile%
rem call:writeAnalytes %analytesInput% "%~1" %xMeta%
rem

Expand Down Expand Up @@ -397,7 +413,7 @@ rem call:getInput "%~1" xMeta "%~3"
rem Type input or get menu?

call:getInput "%~1" xMeta "%~3"
echo %~1: %xMeta% >> %descFile%
echo %~1: %xMeta%>> %descFile%
rem call:writeAnalytes %analytesInput% "%~1" %xMeta%
rem

Expand Down Expand Up @@ -476,7 +492,7 @@ for /f "tokens=1 delims=/" %%a in ("%~3") do set first=%%a
rem echo =%~3=%first%= REM test
if "%xMeta%"=="Other" call:getInput "%~1" xMeta "%first%"
:next
echo %~1: %xMeta%%prefix% >> %descFile%
echo %~1: %xMeta%%prefix%>> %descFile%
rem call:writeAnalytes %analytesInput% "%~1" %xMeta%
rem
REM (ENDLOCAL
Expand Down Expand Up @@ -529,7 +545,7 @@ rem IF EXIST %~1 (
rem echo %searchtext% %modified%
rem pause
rem should replace special token with SampleId before writing
echo %%a %%b!modified! >> tmp.txt
echo %%a %%b!modified!>> tmp.txt
rem echo Write: %%a %%b!modified!
endlocal
rem echo off
Expand Down Expand Up @@ -737,16 +753,16 @@ setlocal enableextensions disabledelayedexpansion
set "%~2=%my_file%")
goto :eof
rem ----------------------------------------------------------
:getSamples --- get sample names from phenodata.txt
:getSamples --- get sample names from %pfn%
:: --- %~1 column name
:: --- %~2 phenodata file name (default is "%iroot%/phenodata.txt")
:: --- %~2 phenodata file name (default is "%iroot%/%pfn%")
:: --- %~3 output file (default is "%sroot%/Analytes.txt")
:: Return: writes the sample names (first two columns) to the output file
:: Example: call:getSamples %Assay_ID%
::
set "infile="
set "outfile="
if "%~2" NEQ "" (set "infile=%~2") else (set "infile=%iroot%/phenodata.txt")
if "%~2" NEQ "" (set "infile=%~2") else (set "infile=%iroot%/%pfn%")
if "%~3" NEQ "" (set "outfile=%~3") else (set "outfile=%sroot%/Analytes.txt")
:: dir %infile%
:: First line
Expand Down Expand Up @@ -780,7 +796,7 @@ for /f "EOL=: delims=" %%L in (%infile%) do (
set "param2=!param2:~1!"
set "param3=!param3:~1!"
rem echo $1=!param1! $2=*!param2!* $3=*!param3!*
if "!param3!" NEQ "" echo !param1! !param2! !param3! >> %outfile%
if "!param3!" NEQ "" echo !param1! !param2! !param3!>> %outfile%
endlocal
)
)
Expand Down Expand Up @@ -825,9 +841,9 @@ rem ------------------------------------------------------------
:: --- %~2 optional delimiter
:: Return: current date in YYYYMMDD form
:: Example: call:normalizeDate
@echo on
echo %~1
echo +%~2+
rem @echo on
rem echo %~1
rem echo +%~2+
@Echo OFF
rem get date format info from registry
rem https://docs.microsoft.com/en-us/windows/desktop/intl/locale-idate
Expand All @@ -852,4 +868,14 @@ IF 1%3 LSS 100 (SET YYYYMMDD=0%3) ELSE (SET YYYYMMDD=%3)
IF 1%2 LSS 100 (SET YYYYMMDD=0%2%sep%%YYYYMMDD%) ELSE (SET YYYYMMDD=%2%sep%%YYYYMMDD%)
:: Similarly for the year - I've never seen a single-digit year
IF 1%1 LSS 100 (SET YYYYMMDD=20%sep%%YYYYMMDD%) ELSE (SET YYYYMMDD=%1%sep%%YYYYMMDD%)
GOTO :eof
GOTO :eof
rem -------------------------------------------------------------------
:showDesc --- show description file in columns
:: --- %~1 file name
::
:: Example: call:showDesc %descFile%
::
setlocal
For /F "TOKENS=1,2" %%A In (%~1) echo %%A %%B
endlocal
goto :EOF
Loading

0 comments on commit 60280c0

Please sign in to comment.