public function img($id) { // $Library_Samples = Library_Samples::find($id); $filepath = $Library_Samples->figure_Path; return response()->download($filepath); }
/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function update(SeqencingCreateFormRequest $request) { $POrecord = POcase::findOrFail($request->get('POrecord_id')); Sequencing::where('POrecord_id', '=', $POrecord->id)->delete(); $sampleName = $request->get('sampleName'); $indexNo = $request->get('indexNo'); $barcode = $request->get('barcode'); $sequencer = $request->get('sequencer'); $sequencerNote = $request->get('sequencerNote'); $length_bp = $request->get('length_bp'); $type = $request->get('type'); $targetQuantity = $request->get('targetQuantity'); $quantityUnit = $request->get('quantityUnit'); $operator = $request->get('operator'); $operatorDate = $request->get('operatorDate'); $note = $request->get('note'); $Library_Sample_id = $request->get('Library_Sample_id'); $max = sizeof($sampleName); for ($i = 0; $i < $max; $i++) { if (!empty($sampleName[$i])) { $targetQuantityBp = ''; if ($quantityUnit[$i] == 'M Reads') { if ($type[$i] == 'SE') { $targetQuantityBp = $length_bp[$i] * $targetQuantity[$i] * 1000000; } elseif ($type[$i] == 'PE') { $targetQuantityBp = $length_bp[$i] * $targetQuantity[$i] * 1000000 * 2; } } elseif ($quantityUnit[$i] == 'Gb') { $targetQuantityBp = $targetQuantity[$i] * 1000000000; } elseif ($quantityUnit[$i] == 'Lane') { if ($sequencer[$i] == 'Illumina - Hiseq X Ten (SINGLE FLOW CELL)') { if ($type[$i] == 'PE') { if ($length_bp[$i] == '150 ') { $targetQuantityBp = $targetQuantity[$i] * 800 * 1000000000; } } } elseif ($sequencer[$i] == 'Illumina - Hiseq X Ten (DUAL FLOW CELL)') { if ($type[$i] == 'PE') { if ($length_bp[$i] == '150 ') { $targetQuantityBp = $targetQuantity[$i] * 1600 * 1000000000; } } } } elseif ($quantityUnit[$i] == 'Run') { if ($sequencer[$i] == 'Illumina - Miseq (V2 KIT)') { if ($type[$i] == 'PE') { if ($length_bp[$i] == '150') { $targetQuantityBp = 4.5 * 1000000000; } elseif ($length_bp[$i] == '250') { $targetQuantityBp = 7.5 * 1000000000; } } } elseif ($sequencer[$i] == 'Illumina - Miseq (V3 KIT)') { if ($type[$i] == 'PE') { if ($length_bp[$i] == '75') { $targetQuantityBp = 3.3 * 1000000000; } elseif ($length_bp[$i] == '300') { $targetQuantityBp = 13.2 * 1000000000; } } } elseif ($sequencer[$i] == 'Illumina - NextSeq 500 (HIGH OUTPUT KIT)') { if ($type[$i] == 'PE') { if ($length_bp[$i] == '75') { $targetQuantityBp = 50 * 1000000000; } elseif ($length_bp[$i] == '150') { $targetQuantityBp = 100 * 1000000000; } } elseif ($type[$i] == 'SE') { if ($length_bp[$i] == '75') { $targetQuantityBp = 25 * 1000000000; } } } elseif ($sequencer[$i] == 'Illumina - NextSeq 500 (MID OUTPUT KIT)') { if ($type[$i] == 'PE') { if ($length_bp[$i] == '75') { $targetQuantityBp = 16.25 * 1000000000; } elseif ($length_bp[$i] == '150') { $targetQuantityBp = 32.5 * 1000000000; } } } elseif ($sequencer[$i] == 'Illumina - Hiseq X Ten (SINGLE FLOW CELL)') { if ($type[$i] == 'PE') { if ($length_bp[$i] == '150 ') { $targetQuantityBp = 800 * 1000000000; } } } elseif ($sequencer[$i] == 'Illumina - Hiseq X Ten (DUAL FLOW CELL)') { if ($type[$i] == 'PE') { if ($length_bp[$i] == '150 ') { $targetQuantityBp = 1600 * 1000000000; } } } } $Sequencing = new Sequencing(array('sampleName' => $sampleName[$i], 'indexNo' => $indexNo[$i], 'barcode' => $barcode[$i], 'sequencer' => $sequencer[$i], 'sequencerNote' => $sequencerNote[$i], 'length_bp' => $length_bp[$i], 'type' => $type[$i], 'targetQuantity' => $targetQuantity[$i], 'quantityUnit' => $quantityUnit[$i], 'operatorDate' => $operatorDate[$i], 'note' => $note[$i], 'targetQuantityBp' => $targetQuantityBp)); $Sequencing->POrecord()->associate($POrecord); $sampleOperator = User::findOrFail($operator[$i]); $Sequencing->operator()->associate($sampleOperator); $library_Samples = Library_Samples::findOrFail($Library_Sample_id[$i]); $Sequencing->Library_Samples()->associate($library_Samples); $Sequencing->save(); } } return \Redirect::to('research/ngs/projects/show/' . $POrecord->project->id)->with('message', 'Your Sequencing has been updated!'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { // $user = \Auth::user(); $library = Library::findOrFail($id); $POrecord = $library->POrecord; $POrecord->status = 'QualityControl'; $POrecord->save(); $project = $POrecord->project; Library_Samples::where('library_id', '=', $library->id)->delete(); $library->delete(); return \Redirect::to('research/ngs/projects/show/' . $project->id)->with('message', 'Your Library has been deleted!'); }