예제 #1
0
    def test_report_info_no_projects(self):
        """report: report run with no projects in 'info' mode
        """
        # Make a mock auto-process directory
        mockdir = MockAnalysisDirFactory.bcl2fastq2(
            '170901_M00879_0087_000000000-AGEW9',
            'miseq',
            metadata={
                "source": "testing",
                "run_number": 87,
                "assay": "Nextera"
            },
            top_dir=self.dirn)
        mockdir.create(no_project_dirs=True)
        # Make autoprocess instance
        ap = AutoProcess(analysis_dir=mockdir.dirn)
        # Generate concise report
        expected = """Run reference: MISEQ_170901#87
Directory    : %s
Platform     : miseq
Unaligned dir: bcl2fastq

Summary of data in 'bcl2fastq' dir:

- AB: AB1-2 (2 paired end samples)
- CDE: CDE3-4 (2 paired end samples)

No analysis projects found""" % mockdir.dirn
        for o, e in zip(report_info(ap).split('\n'), expected.split('\n')):
            self.assertEqual(o, e)
예제 #2
0
    def test_report_info(self):
        """report: report run in 'info' mode
        """
        # Make a mock auto-process directory
        mockdir = MockAnalysisDirFactory.bcl2fastq2(
            '170901_M00879_0087_000000000-AGEW9',
            'miseq',
            metadata={
                "source": "testing",
                "run_number": 87,
                "assay": "Nextera"
            },
            project_metadata={
                "AB": {
                    "User": "******",
                    "Library type": "RNA-seq",
                    "Organism": "Human",
                    "PI": "Audrey Bower"
                },
                "CDE": {
                    "User": "******",
                    "Library type": "ChIP-seq",
                    "Organism": "Mouse",
                    "PI": "Colin Delaney Eccleston"
                }
            },
            top_dir=self.dirn)
        mockdir.create()
        # Make autoprocess instance
        ap = AutoProcess(analysis_dir=mockdir.dirn)
        # Generate concise report
        expected = """Run reference: MISEQ_170901#87
Directory    : %s
Platform     : miseq
Unaligned dir: bcl2fastq

Summary of data in 'bcl2fastq' dir:

- AB: AB1-2 (2 paired end samples)
- CDE: CDE3-4 (2 paired end samples)

3 analysis projects:

- AB
  --
  User    : Alison Bell
  PI      : Audrey Bower
  Library : RNA-seq
  SC Plat.: None
  Organism: Human
  Dir     : AB
  #samples: 2
  #cells  : 
  Samples : AB1-2
  QC      : not verified
  Comments: None

- CDE
  ---
  User    : Charles David Edwards
  PI      : Colin Delaney Eccleston
  Library : ChIP-seq
  SC Plat.: None
  Organism: Mouse
  Dir     : CDE
  #samples: 2
  #cells  : 
  Samples : CDE3-4
  QC      : not verified
  Comments: None

- undetermined
  ------------
  User    : None
  PI      : None
  Library : None
  SC Plat.: None
  Organism: None
  Dir     : undetermined
  #samples: 1
  #cells  : 
  Samples : Undetermined
  QC      : not verified
  Comments: None""" % mockdir.dirn
        for o, e in zip(report_info(ap).split('\n'), expected.split('\n')):
            self.assertEqual(o, e)