|
@@ -59,16 +59,16 @@ const denovoAssemblage = (
|
|
|
// Prepare the fastq files for spades inputs
|
|
// Prepare the fastq files for spades inputs
|
|
|
const rnamesSel = '\'' + rnames.join('\\|') + '\''
|
|
const rnamesSel = '\'' + rnames.join('\\|') + '\''
|
|
|
const tmpSubReads: string[] = []
|
|
const tmpSubReads: string[] = []
|
|
|
- let isfq = []
|
|
|
|
|
|
|
+ let isfq: boolean[] = []
|
|
|
|
|
|
|
|
for (const R of readsIn) {
|
|
for (const R of readsIn) {
|
|
|
const parsedPath = path.parse(R)
|
|
const parsedPath = path.parse(R)
|
|
|
const greper = parsedPath.ext === '.gz' ? 'zgrep' : 'grep'
|
|
const greper = parsedPath.ext === '.gz' ? 'zgrep' : 'grep'
|
|
|
isfq.push(R.match(/\.fq/) ? true : false)
|
|
isfq.push(R.match(/\.fq/) ? true : false)
|
|
|
- const tmp = path.join(os.tmpdir(), (+new Date) + '_' + parsedPath.name + (isfq[isfq.length] ? '.fq' : '.fa'))
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const tmp = path.join(os.tmpdir(), (+new Date) + '_' + parsedPath.name + (isfq[isfq.length-1] ? '.fq' : '.fa'))
|
|
|
tmpSubReads.push(tmp)
|
|
tmpSubReads.push(tmp)
|
|
|
await async_exec(greper, [rnamesSel, R, '-A3', '--no-group-separator', '>', tmp], log, log)
|
|
await async_exec(greper, [rnamesSel, R, '-A3', '--no-group-separator', '>', tmp], log, log)
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const correction = (isfq.filter(e=>e).length !== isfq.length || isfq.filter(e=>e).length === 0) ? '--only-assembler' : ''
|
|
const correction = (isfq.filter(e=>e).length !== isfq.length || isfq.filter(e=>e).length === 0) ? '--only-assembler' : ''
|
|
@@ -101,13 +101,27 @@ export { denovoAssemblage }
|
|
|
/*
|
|
/*
|
|
|
(async()=>{
|
|
(async()=>{
|
|
|
const spadesPath = '/home/thomas/NGS/tools/SPAdes-3.15.0-Linux/bin/spades.py'
|
|
const spadesPath = '/home/thomas/NGS/tools/SPAdes-3.15.0-Linux/bin/spades.py'
|
|
|
- const reads2 = '/home/thomas/Documents/Programmes/ttest/71-mer.fa'
|
|
|
|
|
- const rnames = ['33530080_3', '30971394_3', '77190111_3', '89825138_3',
|
|
|
|
|
- '22481866_3', '111937620_4', '24308941_6', '27758147_3',
|
|
|
|
|
- '87242990_14', '41688638_4', '114699822_3', '48573844_4',
|
|
|
|
|
- '91080996_3', '99644261_3', '77207124_3', '28986564_10',
|
|
|
|
|
- '84400117_4', '10884880_6', '116082011_12', '1739367_3',
|
|
|
|
|
- '13550404_3', '68446023_10', '50560660_3', '9046992_3']
|
|
|
|
|
- console.log(await denovoAssemblage(reads2, rnames, spadesPath));
|
|
|
|
|
|
|
+ const reads2 = ['/home/thomas/Documents/Programmes/ttest/R1r.fq', '/home/thomas/Documents/Programmes/ttest/R2r.fq']
|
|
|
|
|
+ const rnames = [
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:1:1356:7663:10723',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:1:2475:28284:20384',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:1:1274:10646:6339',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:1:1314:10303:30921',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:1:1365:11966:21277',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:1:1425:21151:6778',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:1:2288:25301:5822',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:1:2312:24758:12587',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:1:2410:17110:13808',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:1:2410:17761:15468',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:1:2425:19777:2237',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:1:2429:13575:20149',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:2:1374:20971:34773',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:2:2350:16920:14293',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:1:2274:12707:16736',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:1:2274:12717:16720',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:2:1329:3839:27367',
|
|
|
|
|
+ 'A00680:166:HYCYGDMXX:2:1330:1416:7827'
|
|
|
|
|
+ ]
|
|
|
|
|
+ console.log(await denovoAssemblage(reads2, rnames, spadesPath, console.log));
|
|
|
})()
|
|
})()
|
|
|
*/
|
|
*/
|