Skip to content

Commit 60280c0

Browse files
authored
Merge pull request #22 from NIB-SI/develop
fixes before webinar
2 parents 2b576ab + 851af3a commit 60280c0

20 files changed

+225
-272
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,5 @@ $RECYCLE.BIN/
6464
Network Trash Folder
6565
Temporary Items
6666
.apdisk
67+
Metadata.md
68+
xCheckMetadata.md

INSTRUCTIONS-v-5-0-0.docx

-292 KB
Binary file not shown.

INSTRUCTIONS-v-6.pdf

131 Bytes
Binary file not shown.

INSTRUCTIONS.MD

-135
This file was deleted.

README.MD

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# pISA-tree: Standard project directory tree (ISA compliant)
1+
# pISA-tree: Standard project directory tree (ISA-tab compliant)
22

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

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

1212
Additional info:
1313
* files in `doc` folder

Templates/DRY/R/AssayType.ini

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Creation date %today%

Templates/DRY/Stat/AssayType.ini

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Creation date %today%

Templates/WET/DNAse/AssayType.ini

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Creation date %today%
12
Dnase ID DNase_$
23
Date DNAse_treatment %today%
34
Storage_DNAse_treated CU0370

Templates/WET/Demo/AssayType.ini

-11
This file was deleted.

Templates/WET/RNAisol/AssayType.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Creation date %today%
12
RNA ID $_RNA
23
ng/ul Blank
34
260/280 Blank
@@ -15,4 +16,3 @@ Operator Katja Stare/Anna Coll/Rebecca Vollmeier/Barbara Dusak/Maru
1516
cDNA ID $_cDNA
1617
DateRT %today%
1718
Notes
18-

Templates/WET/RNAisol/AssayType_small.ini

-7
This file was deleted.

Templates/WET/RT/AssayType.ini

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Creation date %today%
12
RT ID RT_$
23
Add column 1 Blank
34
Add column 2 Blank

Templates/makeAssay.bat

+51-25
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ rem Backup copy if assay folder exists
1212
rem robocopy %1 X-%1 /MIR
1313
rem ------------------------------------------------------
1414
rem
15+
TITLE pISA-tree
1516
setlocal EnableDelayedExpansion
1617
set LF=^
1718

@@ -118,7 +119,7 @@ if exist %tmpldir%\DRY\%NewType% (
118119
goto Ask4)
119120
rem type ok
120121
md %tmpldir%\%IDClass%\%NewType%
121-
copy NUL %tmpldir%\%IDClass%\%NewType%\AssayType.ini /Y > NUL
122+
echo Creation date %today%> %tmpldir%\%IDClass%\%NewType%\AssayType.ini
122123
echo New %IDClass% Assay Type was created: %NewType%
123124
set "IDType=%NewType%"
124125
)
@@ -235,11 +236,11 @@ call:getLayer _S_ sname
235236
call:getLayer _A_ aname
236237
rem -------------------------------------- make ASSAY_DESCRIPTION
237238
set descFile=".\_ASSAY_METADATA.TXT"
238-
echo project: %pname%> %descFile%
239-
echo Investigation: %iname%>> %descFile%
239+
echo Assay: %Adir%> %descFile%
240240
echo Study: %sname%>> %descFile%
241-
echo Assay: %Adir%>> %descFile%
242-
echo ### ASSAY>> %descFile%
241+
echo Investigation: %iname%>> %descFile%
242+
echo project: %pname%>> %descFile%
243+
rem echo ### ASSAY>> %descFile%
243244
echo Short Name: %ID%>> %descFile%
244245
echo Assay Class: %IDClass%>> %descFile%
245246
echo Assay Type: %IDType%>> %descFile%
@@ -248,7 +249,21 @@ rem ECHO ON
248249
rem if exist ../%analytesInput% ( copy ../%analytesInput% ./%analytesInput% )
249250
call:inputMeta "Title" aTitle *
250251
call:inputMeta "Description" aDesc *
252+
rem echo Assay Path: %cd:\=/%>> %descFile%
253+
rem set phenodata file
254+
SETLOCAL ENABLEDELAYEDEXPANSION
255+
SET "pfns="
256+
FOR /f "delims=" %%i IN ('dir %iroot%\phenodata_20*.* /B') DO (
257+
SET pfns=!pfns!%%i/
258+
)
259+
SETLOCAL DISABLEDELAYEDEXPANSION
260+
call:getMenu "Select phenodata file" "%pfns%None" pfn
261+
if "%pfn%" EQU "None" ( echo Phenodata: %pfn%>> %descFile%
262+
) ELSE ( echo Phenodata: %iroot:\=/%/%pfn%>> %descFile%)
251263
rem ---- Type specific fields
264+
set tasdir=%tmpldir%\%IDClass%\%IDType%
265+
set "line1="
266+
set "line2="
252267
if /I "%IDClass%"=="WET" goto wetclass
253268
if /I "%IDClass%"=="DRY" goto dryclass
254269
rem if /I "%IDType%" == "R" goto R
@@ -265,16 +280,13 @@ rem echo tst %tmpldir%\%IDClass%\%IDType%\AssayType.ini
265280
rem dir %tmpldir%
266281
rem dir ..\%tmpldir%
267282
rem Assay type directory
268-
set tasdir=%tmpldir%\%IDClass%\%IDType%
269283
rem dir %tasdir%
270284
rem dir %tmpldir%
271285
:: echo %cd%
272286
set "analytesInput=Analytes.txt"
273-
call:getSamples %IDName% %iroot%\phenodata.txt %aroot%\%analytesInput%
287+
call:getSamples %IDName% %iroot%\%pfn% %aroot%\%analytesInput%
274288
setlocal disabledelayedexpansion
275289
rem if exist %sroot%\%analytesInput% ( copy %sroot%\%analytesInput% %aroot%\%analytesInput% )
276-
set "line1="
277-
set "line2="
278290
rem dir %tmpldir%\%IDClass%\%IDType%\
279291
if exist %tasdir%\AssayType.ini call:processAnalytes %tasdir%\AssayType.ini
280292

@@ -292,8 +304,8 @@ REM ---------------------------------------- /dryclass
292304
:Finish
293305
echo Data: >> %descFile%
294306
rem ------------------------------------ include common.ini from project level
295-
copy %descFile%+..\common.ini %descFile% >NUL
296-
echo ASSAY: %ID%>> ..\_STUDY_METADATA.TXT
307+
copy %descFile%+..\common.ini %descFile% \b >NUL
308+
rem echo ASSAY: %ID%>> ..\_STUDY_METADATA.TXT
297309
copy %sroot%\showTree.bat . >NUL
298310
copy %sroot%\showMetadata.bat . >NUL
299311
copy %sroot%\xcheckMetadata.bat . >NUL
@@ -302,8 +314,12 @@ rem
302314
rem make main readme.md file
303315
rem type README.MD
304316
rem dir .
305-
rem cls
306-
rem type %descFile%
317+
cls
318+
echo ======================================
319+
echo Assay METADATA
320+
echo ======================================
321+
rem call:showDesc %descFile%
322+
type %descFile%
307323
cd ..
308324
rem copy existing files from nonversioned tree (if any)
309325
rem robocopy X-%ID% %ID% /E
@@ -369,7 +385,7 @@ rem call:getInput "%~1" xMeta "%~3"
369385
rem Type input or get menu?
370386

371387
call:getMenu "%~1" %~3/getMenu xMeta "%~3"
372-
echo %~1: %xMeta% >> %descFile%
388+
echo %~1: %xMeta%>> %descFile%
373389
rem call:writeAnalytes %analytesInput% "%~1" %xMeta%
374390
rem
375391

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

399415
call:getInput "%~1" xMeta "%~3"
400-
echo %~1: %xMeta% >> %descFile%
416+
echo %~1: %xMeta%>> %descFile%
401417
rem call:writeAnalytes %analytesInput% "%~1" %xMeta%
402418
rem
403419

@@ -476,7 +492,7 @@ for /f "tokens=1 delims=/" %%a in ("%~3") do set first=%%a
476492
rem echo =%~3=%first%= REM test
477493
if "%xMeta%"=="Other" call:getInput "%~1" xMeta "%first%"
478494
:next
479-
echo %~1: %xMeta%%prefix% >> %descFile%
495+
echo %~1: %xMeta%%prefix%>> %descFile%
480496
rem call:writeAnalytes %analytesInput% "%~1" %xMeta%
481497
rem
482498
REM (ENDLOCAL
@@ -529,7 +545,7 @@ rem IF EXIST %~1 (
529545
rem echo %searchtext% %modified%
530546
rem pause
531547
rem should replace special token with SampleId before writing
532-
echo %%a %%b!modified! >> tmp.txt
548+
echo %%a %%b!modified!>> tmp.txt
533549
rem echo Write: %%a %%b!modified!
534550
endlocal
535551
rem echo off
@@ -737,16 +753,16 @@ setlocal enableextensions disabledelayedexpansion
737753
set "%~2=%my_file%")
738754
goto :eof
739755
rem ----------------------------------------------------------
740-
:getSamples --- get sample names from phenodata.txt
756+
:getSamples --- get sample names from %pfn%
741757
:: --- %~1 column name
742-
:: --- %~2 phenodata file name (default is "%iroot%/phenodata.txt")
758+
:: --- %~2 phenodata file name (default is "%iroot%/%pfn%")
743759
:: --- %~3 output file (default is "%sroot%/Analytes.txt")
744760
:: Return: writes the sample names (first two columns) to the output file
745761
:: Example: call:getSamples %Assay_ID%
746762
::
747763
set "infile="
748764
set "outfile="
749-
if "%~2" NEQ "" (set "infile=%~2") else (set "infile=%iroot%/phenodata.txt")
765+
if "%~2" NEQ "" (set "infile=%~2") else (set "infile=%iroot%/%pfn%")
750766
if "%~3" NEQ "" (set "outfile=%~3") else (set "outfile=%sroot%/Analytes.txt")
751767
:: dir %infile%
752768
:: First line
@@ -780,7 +796,7 @@ for /f "EOL=: delims=" %%L in (%infile%) do (
780796
set "param2=!param2:~1!"
781797
set "param3=!param3:~1!"
782798
rem echo $1=!param1! $2=*!param2!* $3=*!param3!*
783-
if "!param3!" NEQ "" echo !param1! !param2! !param3! >> %outfile%
799+
if "!param3!" NEQ "" echo !param1! !param2! !param3!>> %outfile%
784800
endlocal
785801
)
786802
)
@@ -825,9 +841,9 @@ rem ------------------------------------------------------------
825841
:: --- %~2 optional delimiter
826842
:: Return: current date in YYYYMMDD form
827843
:: Example: call:normalizeDate
828-
@echo on
829-
echo %~1
830-
echo +%~2+
844+
rem @echo on
845+
rem echo %~1
846+
rem echo +%~2+
831847
@Echo OFF
832848
rem get date format info from registry
833849
rem https://docs.microsoft.com/en-us/windows/desktop/intl/locale-idate
@@ -852,4 +868,14 @@ IF 1%3 LSS 100 (SET YYYYMMDD=0%3) ELSE (SET YYYYMMDD=%3)
852868
IF 1%2 LSS 100 (SET YYYYMMDD=0%2%sep%%YYYYMMDD%) ELSE (SET YYYYMMDD=%2%sep%%YYYYMMDD%)
853869
:: Similarly for the year - I've never seen a single-digit year
854870
IF 1%1 LSS 100 (SET YYYYMMDD=20%sep%%YYYYMMDD%) ELSE (SET YYYYMMDD=%1%sep%%YYYYMMDD%)
855-
GOTO :eof
871+
GOTO :eof
872+
rem -------------------------------------------------------------------
873+
:showDesc --- show description file in columns
874+
:: --- %~1 file name
875+
::
876+
:: Example: call:showDesc %descFile%
877+
::
878+
setlocal
879+
For /F "TOKENS=1,2" %%A In (%~1) echo %%A %%B
880+
endlocal
881+
goto :EOF

0 commit comments

Comments
 (0)